Class: SAML2::AuthnStatement
Defined Under Namespace
Modules: Classes
Instance Attribute Summary collapse
-
#authn_context_class_ref ⇒ String?
One of the values in Classes.
- #authn_instant ⇒ Time
- #session_index ⇒ String?
- #session_not_on_or_after ⇒ Time?
Attributes inherited from Base
Instance Method Summary collapse
-
#build(builder) ⇒ void
Serialize this object to XML, as part of a larger document.
-
#from_xml(node) ⇒ void
Parse an XML element into this object.
Methods inherited from Base
#decrypt, from_xml, #initialize, #inspect, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml
Constructor Details
This class inherits a constructor from SAML2::Base
Instance Attribute Details
#authn_context_class_ref ⇒ String?
One of the values in Classes.
52 53 54 |
# File 'lib/saml2/authn_statement.rb', line 52 def authn_context_class_ref @authn_context_class_ref end |
#authn_instant ⇒ Time
49 50 51 |
# File 'lib/saml2/authn_statement.rb', line 49 def authn_instant @authn_instant end |
#session_index ⇒ String?
54 55 56 |
# File 'lib/saml2/authn_statement.rb', line 54 def session_index @session_index end |
#session_not_on_or_after ⇒ Time?
56 57 58 |
# File 'lib/saml2/authn_statement.rb', line 56 def session_not_on_or_after @session_not_on_or_after end |
Instance Method Details
#build(builder) ⇒ void
This method returns an undefined value.
Serialize this object to XML, as part of a larger document
69 70 71 72 73 74 75 76 77 |
# File 'lib/saml2/authn_statement.rb', line 69 def build(builder) builder["saml"].AuthnStatement("AuthnInstant" => authn_instant.iso8601) do |authn_statement| authn_statement.parent["SessionIndex"] = session_index if session_index authn_statement.parent["SessionNotOnOrAfter"] = session_not_on_or_after.iso8601 if session_not_on_or_after authn_statement["saml"].AuthnContext do |authn_context| authn_context["saml"].AuthnContextClassRef(authn_context_class_ref) if authn_context_class_ref end end end |
#from_xml(node) ⇒ void
This method returns an undefined value.
Parse an XML element into this object.
59 60 61 62 63 64 65 66 |
# File 'lib/saml2/authn_statement.rb', line 59 def from_xml(node) super @authn_instant = Time.parse(node["AuthnInstant"]) @session_index = node["SessionIndex"] @session_not_on_or_after = Time.parse(node["SessionNotOnOrAfter"]) if node["SessionNotOnOrAfter"] @authn_context_class_ref = node.at_xpath("saml:AuthnContext/saml:AuthnContextClassRef", Namespaces::ALL)&.content&.strip end |