Class: Saml::Kit::Response
Overview
This class is responsible for validating and parsing a SAML Response document.
Constant Summary
Constants inherited from Document
Document::NAMESPACES, Document::PROTOCOL_XSD, Document::XPATH
Instance Attribute Summary
Attributes included from Respondable
Attributes inherited from Document
Instance Method Summary collapse
- #assertion(private_keys = configuration.private_keys(use: :encryption)) ⇒ Object
-
#initialize(xml, request_id: nil, configuration: Saml::Kit.configuration) ⇒ Response
constructor
A new instance of Response.
Methods included from Respondable
#in_response_to, #status_code, #status_message, #success?
Methods inherited from Document
#destination, #id, #issue_instant, #issuer, #to_h, #to_s, to_saml_document, #to_xhtml, #to_xml, #version
Methods included from Trustable
Constructor Details
#initialize(xml, request_id: nil, configuration: Saml::Kit.configuration) ⇒ Response
Returns a new instance of Response.
17 18 19 20 |
# File 'lib/saml/kit/response.rb', line 17 def initialize(xml, request_id: nil, configuration: Saml::Kit.configuration) @request_id = request_id super(xml, name: 'Response', configuration: configuration) end |
Instance Method Details
#assertion(private_keys = configuration.private_keys(use: :encryption)) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/saml/kit/response.rb', line 22 def assertion(private_keys = configuration.private_keys(use: :encryption)) @assertion ||= begin node = assertion_nodes.last if node.nil? Saml::Kit::NullAssertion.new else Saml::Kit::Assertion.new(node, configuration: @configuration, private_keys: private_keys) end end end |