Class: Spid::Sso::Response
Overview
Instance Attribute Summary collapse
Instance Method Summary
collapse
#certificate_from_encoded_der, #decode, #decode_and_inflate, #deflate, #deflate_and_encode, #encode, #escaped_params, #escaped_query_string, #inflate, #query_param, #query_params, #query_string
Constructor Details
#initialize(body:, request_uuid:) ⇒ Response
Returns a new instance of Response.
15
16
17
18
19
|
# File 'lib/spid/sso/response.rb', line 15
def initialize(body:, request_uuid:)
@body = body
@saml_message = decode_and_inflate(body)
@request_uuid = request_uuid
end
|
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
11
12
13
|
# File 'lib/spid/sso/response.rb', line 11
def body
@body
end
|
#request_uuid ⇒ Object
Returns the value of attribute request_uuid.
13
14
15
|
# File 'lib/spid/sso/response.rb', line 13
def request_uuid
@request_uuid
end
|
#saml_message ⇒ Object
Returns the value of attribute saml_message.
12
13
14
|
# File 'lib/spid/sso/response.rb', line 12
def saml_message
@saml_message
end
|
Instance Method Details
#attributes ⇒ Object
42
43
44
45
46
|
# File 'lib/spid/sso/response.rb', line 42
def attributes
raw_attributes.each_with_object({}) do |(key, value), acc|
acc[normalize_key(key)] = value
end
end
|
#errors ⇒ Object
38
39
40
|
# File 'lib/spid/sso/response.rb', line 38
def errors
validator.errors
end
|
#identity_provider ⇒ Object
#issuer ⇒ Object
34
35
36
|
# File 'lib/spid/sso/response.rb', line 34
def issuer
saml_response.assertion_issuer
end
|
#raw_attributes ⇒ Object
52
53
54
|
# File 'lib/spid/sso/response.rb', line 52
def raw_attributes
saml_response.attributes
end
|
#saml_response ⇒ Object
66
67
68
|
# File 'lib/spid/sso/response.rb', line 66
def saml_response
@saml_response ||= Spid::Saml2::Response.new(saml_message: saml_message)
end
|
#service_provider ⇒ Object
61
62
63
64
|
# File 'lib/spid/sso/response.rb', line 61
def service_provider
@service_provider ||=
Spid.configuration.service_provider
end
|
#session_index ⇒ Object
48
49
50
|
# File 'lib/spid/sso/response.rb', line 48
def session_index
saml_response.session_index
end
|
#settings ⇒ Object
70
71
72
73
74
75
|
# File 'lib/spid/sso/response.rb', line 70
def settings
@settings ||= Spid::Saml2::Settings.new(
identity_provider: identity_provider,
service_provider: service_provider
)
end
|
#valid? ⇒ Boolean
21
22
23
|
# File 'lib/spid/sso/response.rb', line 21
def valid?
validator.call
end
|
#validator ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'lib/spid/sso/response.rb', line 25
def validator
@validator ||=
Spid::Saml2::ResponseValidator.new(
response: saml_response,
settings: settings,
request_uuid: request_uuid
)
end
|