Class: SSO::Client::Warden::Strategies::Passport
- Inherits:
-
Warden::Strategies::Base
- Object
- Warden::Strategies::Base
- SSO::Client::Warden::Strategies::Passport
- Includes:
- Benchmarking, Logging
- Defined in:
- lib/sso/client/warden/strategies/passport.rb
Overview
When the iPhone presents a Passport to Alpha, this is how Alpha verifies it with Bouncer.
Instance Method Summary collapse
Methods included from Benchmarking
Methods included from Meter
#caller_name, #metric, #timing, #track
Methods included from Logging
#debug, #error, #fatal, #info, #logger, #progname, #warn
Instance Method Details
#authenticate! ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/sso/client/warden/strategies/passport.rb', line 14 def authenticate! debug { 'Authenticating from Passport...' } authentication = passport_authentication track key: 'client.warden.strategies.passport.authentication', tags: { scope: scope } if authentication.success? debug { 'Authentication on Client from Passport successful.' } debug { "Persisting trusted Passport #{authentication.object.inspect}" } track key: "client.warden.strategies.passport.#{authentication.code}", tags: { scope: scope } success! authentication.object else debug { 'Authentication from Passport on Client failed.' } debug { "Responding with #{authentication.object.inspect}" } track key: "client.warden.strategies.passport.#{authentication.code}", tags: { scope: scope } custom! authentication.object end rescue => exception ::SSO.config.exception_handler.call exception end |
#passport_authentication ⇒ Object
36 37 38 39 40 |
# File 'lib/sso/client/warden/strategies/passport.rb', line 36 def passport_authentication benchmark(name: 'Passport proxy verification request', metric: 'client.passport.proxy_verification.duration') do ::SSO::Client::Authentications::Passport.new(request).authenticate end end |
#valid? ⇒ Boolean
10 11 12 |
# File 'lib/sso/client/warden/strategies/passport.rb', line 10 def valid? params['auth_version'].to_s != '' && params['state'] != '' end |