class SamlIdp::LogoutResponseBuilder

Attributes

algorithm[RW]
issuer_uri[RW]
response_id[RW]
saml_request_id[RW]
saml_slo_url[RW]

Public Class Methods

new(response_id, issuer_uri, saml_slo_url, saml_request_id, algorithm) click to toggle source
# File lib/saml_idp/logout_response_builder.rb, line 10
def initialize(response_id, issuer_uri, saml_slo_url, saml_request_id, algorithm)
  self.response_id = response_id
  self.issuer_uri = issuer_uri
  self.saml_slo_url = saml_slo_url
  self.saml_request_id = saml_request_id
  self.algorithm = algorithm
end

Private Instance Methods

build() click to toggle source
# File lib/saml_idp/logout_response_builder.rb, line 18
def build
  builder = Builder::XmlMarkup.new
  builder.LogoutResponse ID: response_id_string,
    Version: "2.0",
    IssueInstant: now_iso,
    Destination: saml_slo_url,
    InResponseTo: saml_request_id,
    xmlns: Saml::XML::Namespaces::PROTOCOL do |response|
      response.Issuer issuer_uri, xmlns: Saml::XML::Namespaces::ASSERTION
      sign response
      response.Status xmlns: Saml::XML::Namespaces::PROTOCOL do |status|
        status.StatusCode Value: Saml::XML::Namespaces::Statuses::SUCCESS 
      end 
    end 
end