Class: SAML2::Status
Constant Summary collapse
- SUCCESS =
"urn:oasis:names:tc:SAML:2.0:status:Success"- REQUESTER =
"urn:oasis:names:tc:SAML:2.0:status:Requester"- RESPONDER =
"urn:oasis:names:tc:SAML:2.0:status:Responder"- VERSION_MISMATCH =
"urn:oasis:names:tc:SAML:2.0:status:VersionMismatch"- AUTHN_FAILED =
"urn:oasis:names:tc:SAML:2.0:status:AuthnFailed"- INVALID_ATTR_NAME_OR_VALUE =
"urn:oasis:names:tc:SAML:2.0:status:InvalidAttrNameOrValue"- INVALID_NAME_ID_POLICY =
"urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy"- NO_AUTHN_CONTEXT =
"urn:oasis:names:tc:SAML:2.0:status:NoAuthnContext"- NO_AVAILABLE_IDP =
"urn:oasis:names:tc:SAML:2.0:status:NoAvailableIDP"- NO_PASSIVE =
"urn:oasis:names:tc:SAML:2.0:status:NoPassive"- NO_SUPPORTED_IDP =
"urn:oasis:names:tc:SAML:2.0:status:NoSupportedIDP"- PARTIAL_LOGOUT =
"urn:oasis:names:tc:SAML:2.0:status:PartialLogout"- PROXY_COUNT_EXCEEDED =
"urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded"- REQUEST_DENIED =
"urn:oasis:names:tc:SAML:2.0:status:RequestDenied"- REQUEST_UNSUPPORTED =
"urn:oasis:names:tc:SAML:2.0:status:RequestUnsupported"- REQUEST_VERSION_DEPRECATED =
"urn:oasis:names:tc:SAML:2.0:status:RequestVersionDeprecated"- REQUEST_VERSION_TOO_HIGH =
"urn:oasis:names:tc:SAML:2.0:status:RequestVersionTooHigh"- REQUEST_VERSION_TOO_LOW =
"urn:oasis:names:tc:SAML:2.0:status:RequestVersionTooLow"- RESOURCE_NOT_RECOGNIZED =
"urn:oasis:names:tc:SAML:2.0:status:ResourceNotRecognized"- TOO_MANY_RESPONSES =
"urn:oasis:names:tc:SAML::2.0:status:TooManyResponses"- UNKNOWN_ATTR_PROFILE =
"urn:oasis:names:tc:SAML:2.0:status:UnknownAttrProfile"- UNKNOWN_PRINCIPAL =
"urn:oasis:names:tc:SAML:2.0:status:UnknownPrincipal"- UNSUPPORTED_BINDING =
"urn:oasis:names:tc:SAML:2.0:status:UnsupportedBinding"- TOP_LEVEL_STATUS_CODES =
[SUCCESS, REQUESTER, RESPONDER, VERSION_MISMATCH].freeze
Instance Attribute Summary collapse
Attributes inherited from Base
Instance Method Summary collapse
-
#build(builder) ⇒ void
Serialize this object to XML, as part of a larger document.
- #code ⇒ Object
-
#from_xml(node) ⇒ void
Parse an XML element into this object.
-
#initialize(code = SUCCESS, message = nil, detail = nil) ⇒ Status
constructor
A new instance of Status.
- #success? ⇒ Boolean
Methods inherited from Base
#decrypt, from_xml, #inspect, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml
Constructor Details
Instance Attribute Details
#codes ⇒ Array<String>
35 36 37 |
# File 'lib/saml2/status.rb', line 35 def codes @codes end |
#detail ⇒ String
37 38 39 |
# File 'lib/saml2/status.rb', line 37 def detail @detail end |
#message ⇒ String
37 38 39 |
# File 'lib/saml2/status.rb', line 37 def @message end |
Instance Method Details
#build(builder) ⇒ void
This method returns an undefined value.
Serialize this object to XML, as part of a larger document
84 85 86 87 88 89 90 91 |
# File 'lib/saml2/status.rb', line 84 def build(builder) builder["samlp"].Status do |status| build_code(status, codes, 0) status["samlp"].StatusMessage() if status["samlp"].StatusDetail(detail) if detail end end |
#code ⇒ Object
65 66 67 |
# File 'lib/saml2/status.rb', line 65 def code codes.first end |
#from_xml(node) ⇒ void
This method returns an undefined value.
Parse an XML element into this object.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/saml2/status.rb', line 49 def from_xml(node) super @codes.clear code_node = node loop do code_node = code_node.at_xpath("samlp:StatusCode", Namespaces::ALL) break unless code_node codes << code_node["Value"] end self. = xml.at_xpath("samlp:StatusMessage", Namespaces::ALL)&.content&.strip self.detail = xml.at_xpath("samlp:StatusDetail", Namespaces::ALL)&.content&.strip end |