Class: VerifyVspClient::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/verify_vsp_client/response.rb

Overview

Represents a Response from a Verify authentication attempt.

Use by calling VerifyVspClient::Response.translate to translate a SAML response using the Verify Service Provider, for example:

VerifyVspClient::Response.translate(saml_response: "SOME SAML", request_id: "REQUEST_ID", level_of_assurance: "LEVEL_2")

Defined Under Namespace

Classes: MissingResponseAttribute

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameters) ⇒ Response

Returns a new instance of Response.



13
14
15
# File 'lib/verify_vsp_client/response.rb', line 13

def initialize(parameters)
  @parameters = parameters
end

Instance Attribute Details

#parametersObject (readonly)

Returns the value of attribute parameters.



11
12
13
# File 'lib/verify_vsp_client/response.rb', line 11

def parameters
  @parameters
end

Class Method Details

.translate(saml_response:, request_id:, level_of_assurance:) ⇒ Object



17
18
19
20
# File 'lib/verify_vsp_client/response.rb', line 17

def self.translate(saml_response:, request_id:, level_of_assurance:)
  parameters = VerifyVspClient::ServiceProvider.new.translate_response(saml_response, request_id, level_of_assurance)
  new(parameters)
end

Instance Method Details

#scenarioObject



26
27
28
# File 'lib/verify_vsp_client/response.rb', line 26

def scenario
  @scenario ||= parameters["scenario"]
end

#verified?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/verify_vsp_client/response.rb', line 22

def verified?
  scenario == VerifyVspClient::IDENTITY_VERIFIED_SCENARIO
end