Class: Warden::OAuth2::Strategies::Bearer
- Inherits:
-
Token
- Object
- Strategies::Base
- Base
- Token
- Warden::OAuth2::Strategies::Bearer
show all
- Defined in:
- lib/warden/oauth2/strategies/bearer.rb
Instance Attribute Summary
Attributes inherited from Base
#error_description
Instance Method Summary
collapse
Methods inherited from Token
#authenticate!, #error_status, #token
Methods inherited from Base
#error_status, #store?
Instance Method Details
#token_string ⇒ Object
11
12
13
|
# File 'lib/warden/oauth2/strategies/bearer.rb', line 11
def token_string
|| token_string_from_request_params
end
|
15
16
17
18
19
20
21
22
|
# File 'lib/warden/oauth2/strategies/bearer.rb', line 15
def
Rack::Auth::AbstractRequest::AUTHORIZATION_KEYS.each do |key|
if env.key?(key) && token_string = env[key][/^Bearer (.*)/, 1]
return token_string
end
end
nil
end
|
#token_string_from_request_params ⇒ Object
24
25
26
|
# File 'lib/warden/oauth2/strategies/bearer.rb', line 24
def token_string_from_request_params
params['access_token']
end
|
#valid? ⇒ Boolean
7
8
9
|
# File 'lib/warden/oauth2/strategies/bearer.rb', line 7
def valid?
!!token_string
end
|