Class: SSO::Server::Warden::Strategies::Passport

Inherits:
Warden::Strategies::Base
  • Object
show all
Includes:
Benchmarking, Logging
Defined in:
lib/sso/server/warden/strategies/passport.rb

Instance Method Summary collapse

Methods included from Benchmarking

#benchmark

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
# File 'lib/sso/server/warden/strategies/passport.rb', line 13

def authenticate!
  debug { 'Authenticating from Passport...' }

  authentication = passport_authentication

  if authentication.success?
    debug { 'Authentication on Server from Passport successful.' }
    debug { "Responding with #{authentication.object}" }
    custom! authentication.object
  else
    debug { 'Authentication from Passport failed.' }
    fail authentication.code
  end

rescue => exception
  ::SSO.config.exception_handler.call exception
end

#passport_authenticationObject



31
32
33
34
35
# File 'lib/sso/server/warden/strategies/passport.rb', line 31

def passport_authentication
  benchmark 'Passport verification' do
    ::SSO::Server::Authentications::Passport.new(request).authenticate
  end
end

#valid?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/sso/server/warden/strategies/passport.rb', line 9

def valid?
  params['auth_version'].to_s != '' && params['state'] != ''
end