Class: SSO::Server::Authentications::Passport

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/sso/server/authentications/passport.rb

Instance Method Summary collapse

Methods included from Logging

#debug, #error, #fatal, #info, #logger, #progname, #warn

Constructor Details

#initialize(request) ⇒ Passport

Returns a new instance of Passport.



7
8
9
# File 'lib/sso/server/authentications/passport.rb', line 7

def initialize(request)
  @request = request
end

Instance Method Details

#authenticateObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/sso/server/authentications/passport.rb', line 11

def authenticate
  result = authenticate!

  if result.success?
    result
  else
    # TODO: Prevent Flooding here.
    debug { "The Server Passport authentication failed: #{result.code}" }
    Operations.failure :passport_authentication_failed, object: failure_rack_array
  end
end