Class: SSO::Client::Warden::Strategies::Passport
- Inherits:
-
Warden::Strategies::Base
- Object
- Warden::Strategies::Base
- SSO::Client::Warden::Strategies::Passport
show all
- 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
#benchmark
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
|
# File 'lib/sso/client/warden/strategies/passport.rb', line 14
def authenticate!
debug { 'Authenticating from Passport...' }
authentication = passport_authentication
if authentication.success?
debug { 'Authentication on Client from Passport successful.' }
debug { "Persisting trusted Passport #{authentication.object.inspect}" }
success! authentication.object
else
debug { 'Authentication from Passport failed.' }
debug { "Responding with #{authentication.object.inspect}" }
custom! authentication.object
end
rescue => exception
::SSO.config.exception_handler.call exception
end
|
#passport_authentication ⇒ Object
#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
|