Class: Hadley::Authz::Bearer::Strategy
- Inherits:
-
Strategy
- Object
- Warden::Strategies::Base
- Strategy
- Hadley::Authz::Bearer::Strategy
- Defined in:
- lib/hadley/authz/bearer.rb
Instance Method Summary collapse
Methods inherited from Strategy
Methods included from StrategyBuilder
Instance Method Details
#auth ⇒ Object
25 26 27 |
# File 'lib/hadley/authz/bearer.rb', line 25 def auth @auth ||= Rack::Auth::Bearer::Request.new(env) end |
#authenticate!(anonymous_allowed = false) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/hadley/authz/bearer.rb', line 33 def authenticate!(anonymous_allowed=false) return unless auth.provided? and auth.bearer? and auth.token user = config.token_store.get(auth.token) return unless user and (!user[:anonymous] or config.anonymous_allowed) success!(user) end |
#store? ⇒ Boolean
29 30 31 |
# File 'lib/hadley/authz/bearer.rb', line 29 def store? false end |