Module: Hadley::Authz::Bearer::ConfigExtension
- Defined in:
- lib/hadley/authz/bearer.rb
Instance Method Summary collapse
Instance Method Details
#bearer(name, &block) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/hadley/authz/bearer.rb', line 50 def bearer(name, &block) config = Hadley::Config.new( realm: 'Access Tokens', fail_message: 'Authorization Failed', anonymous_allowed: false ) if block_given? if block.arity == 1 yield config else config.instance_eval(&block) end end Hadley::Authz::Bearer::Strategy.build(name, config) unless config.token_store.nil? end |