SAML2 Logout Request (SLO IdP initiated, Parser)
OneLogin::RubySaml::Settings Toolkit settings
@return [String|nil] Gets the ID attribute from the Logout Request. if exists.
# File lib/onelogin/ruby-saml/slo_logoutrequest.rb, line 71 def id super(document) end
Validates the Logout Request with the default values (soft = true) @param collect_errors [Boolean] Stop validation when first error appears or keep validating. @return [Boolean] TRUE if the Logout Request is valid
# File lib/onelogin/ruby-saml/slo_logoutrequest.rb, line 54 def is_valid?(collect_errors = false) validate(collect_errors) end
@return [String] Gets the Issuer from the Logout Request.
# File lib/onelogin/ruby-saml/slo_logoutrequest.rb, line 77 def issuer @issuer ||= begin node = REXML::XPath.first( document, "/p:LogoutRequest/a:Issuer", { "p" => PROTOCOL, "a" => ASSERTION } ) node.nil? ? nil : node.text end end
@return [String] Gets the NameID of the Logout Request.
# File lib/onelogin/ruby-saml/slo_logoutrequest.rb, line 60 def name_id @name_id ||= begin node = REXML::XPath.first(document, "/p:LogoutRequest/a:NameID", { "p" => PROTOCOL, "a" => ASSERTION }) node.nil? ? nil : node.text end end
@return [Time|nil] Gets the NotOnOrAfter Attribute value if exists.
# File lib/onelogin/ruby-saml/slo_logoutrequest.rb, line 90 def not_on_or_after @not_on_or_after ||= begin node = REXML::XPath.first( document, "/p:LogoutRequest", { "p" => PROTOCOL } ) if node && node.attributes["NotOnOrAfter"] Time.parse(node.attributes["NotOnOrAfter"]) end end end
@return [Array] Gets the SessionIndex if exists (Supported multiple values). Empty Array if none found
# File lib/onelogin/ruby-saml/slo_logoutrequest.rb, line 105 def session_indexes s_indexes = [] nodes = REXML::XPath.match( document, "/p:LogoutRequest/p:SessionIndex", { "p" => PROTOCOL } ) nodes.each do |node| s_indexes << node.text end s_indexes end
Constructs the Logout Request. A Logout Request Object that is an extension of the SamlMessage class. @param request [String] A UUEncoded Logout Request from the IdP. @param options [Hash] :settings to provide the OneLogin::RubySaml::Settings object
Or :allowed_clock_drift for the logout request validation process to allow a clock drift when checking dates with Or :relax_signature_validation to accept signatures if no idp certificate registered on settings
@raise [ArgumentError] If Request is nil
# File lib/onelogin/ruby-saml/slo_logoutrequest.rb, line 33 def initialize(request, options = {}) raise ArgumentError.new("Request cannot be nil") if request.nil? @errors = [] @options = options @soft = true unless options[:settings].nil? @settings = options[:settings] unless @settings.soft.nil? @soft = @settings.soft end end @request = decode_raw_saml(request) @document = REXML::Document.new(@request) end