Class: SAML2::LogoutResponse

Inherits:
StatusResponse show all
Defined in:
lib/saml2/logout_response.rb

Instance Attribute Summary

Attributes inherited from StatusResponse

#in_response_to, #status

Attributes inherited from Message

#destination, #errors, #issuer

Attributes inherited from Base

#xml

Class Method Summary collapse

Methods inherited from StatusResponse

#from_xml, #initialize

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::StatusResponse

Class Method Details

.respond_to(logout_request, sso, issuer, status_code = Status::SUCCESS, binding: Bindings::HTTPRedirect::URN, message: nil) ⇒ LogoutResponse

Parameters:

  • logout_request (LogoutRequest)
  • sso (SSO, nil)
  • issuer (NameID)
  • status_code (String) (defaults to: Status::SUCCESS)
  • binding (String) (defaults to: Bindings::HTTPRedirect::URN)

    the binding to use for the response

Returns:



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/saml2/logout_response.rb', line 13

def self.respond_to(logout_request,
                    sso,
                    issuer,
                    status_code = Status::SUCCESS,
                    binding: Bindings::HTTPRedirect::URN,
                    message: nil)
  logout_response = new
  logout_response.issuer = issuer
  if sso
    logout_response.destination = sso.single_logout_services.choose_endpoint(binding)&.effective_response_location
  end
  logout_response.in_response_to = logout_request.id
  logout_response.status.code = status_code
  logout_response.status.message = message
  logout_response
end