Class: SAML2::LogoutRequest

Inherits:
Request show all
Defined in:
lib/saml2/logout_request.rb

Instance Attribute Summary collapse

Attributes inherited from Message

#destination, #errors, #issuer

Attributes inherited from Base

#xml

Class Method Summary collapse

Methods inherited from Message

from_xml, #from_xml, #id, #initialize, #issue_instant, parse, #sign, #valid_schema?, #validate

Methods included from Signable

#sign, #signature, #signed?, #signing_key, #valid_signature?, #validate_signature

Methods inherited from Base

#decrypt, from_xml, #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::Message

Instance Attribute Details

#name_idNameID

Returns:



26
27
28
# File 'lib/saml2/logout_request.rb', line 26

def name_id
  @name_id ||= (NameID.from_xml(xml.at_xpath("saml:NameID", Namespaces::ALL)) if xml)
end

#session_indexString+

Returns:

  • (String, Array<String>)


31
32
33
# File 'lib/saml2/logout_request.rb', line 31

def session_index
  @session_index ||= (load_string_array(xml, "samlp:SessionIndex") if xml)
end

Class Method Details

.initiate(sso, issuer, name_id, session_index = []) ⇒ LogoutRequest

Parameters:

  • sso (SSO)
  • issuer (NameID)
  • name_id (NameID)
  • session_index (defaults to: [])

    optional [String, Array<String>]

Returns:



15
16
17
18
19
20
21
22
23
# File 'lib/saml2/logout_request.rb', line 15

def self.initiate(sso, issuer, name_id, session_index = [])
  logout_request = new
  logout_request.issuer = issuer
  logout_request.destination = sso.single_logout_services.first.location
  logout_request.name_id = name_id
  logout_request.session_index = session_index

  logout_request
end