Class: SSO::Client::Authentications::Passport

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

Overview

Logic to authenticate a Passport provided by an outsider app to an insider app.

Instance Method Summary collapse

Methods included from Benchmarking

#benchmark

Methods included from Logging

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

Constructor Details

#initialize(request) ⇒ Passport

Returns a new instance of Passport.



11
12
13
# File 'lib/sso/client/authentications/passport.rb', line 11

def initialize(request)
  @request = request
end

Instance Method Details

#authenticateObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/sso/client/authentications/passport.rb', line 15

def authenticate
  debug { 'Performing authentication...' }
  result = authenticate!

  if result.success?
    debug { 'Authentication succeeded.' }
    return result
  end

  debug { "The Client Passport authentication failed: #{result.code}" }
  Operations.failure :passport_authentication_failed, object: failure_rack_array
end