Class: SSO::Server::Warden::Strategies::Passport
- Inherits:
-
Warden::Strategies::Base
- Object
- Warden::Strategies::Base
- SSO::Server::Warden::Strategies::Passport
show all
- Includes:
- Benchmarking, Logging
- Defined in:
- lib/sso/server/warden/strategies/passport.rb
Instance Method Summary
collapse
#benchmark
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
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/sso/server/warden/strategies/passport.rb', line 13
def authenticate!
debug { 'Authenticating from Passport...' }
authentication = passport_authentication
track key: 'server.warden.strategies.passport.authentication'
if authentication.success?
debug { 'Authentication on Server from Passport successful.' }
debug { "Responding with #{authentication.object}" }
track key: "server.warden.strategies.passport.#{authentication.code}"
custom! authentication.object
else
debug { 'Authentication from Passport on Server failed.' }
track key: "server.warden.strategies.passport.#{authentication.code}"
custom! authentication.object
end
rescue => exception
::SSO.config.exception_handler.call exception
end
|
#passport_authentication ⇒ Object
#valid? ⇒ Boolean
9
10
11
|
# File 'lib/sso/server/warden/strategies/passport.rb', line 9
def valid?
params['auth_version'].to_s != '' && params['state'] != ''
end
|