Module: Samlr::Tools::LogoutResponseBuilder
- Defined in:
- lib/samlr/tools/logout_response_builder.rb
Overview
Use this for building the SAML logout response XML
Class Method Summary collapse
Class Method Details
.build(options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/samlr/tools/logout_response_builder.rb', line 7 def self.build( = {}) status_code = [:status_code] || "urn:oasis:names:tc:SAML:2.0:status:Success" builder = Nokogiri::XML::Builder.new do |xml| xml.LogoutResponse(()) do xml.doc.root.namespace = xml.doc.root.namespace_definitions.find { |ns| ns.prefix == "samlp" } xml["saml"].Issuer([:issuer]) if [:issuer] xml["samlp"].Status { |xml| xml["samlp"].StatusCode("Value" => status_code) } end end builder.to_xml(COMPACT) end |
.logout_response_options(options) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/samlr/tools/logout_response_builder.rb', line 19 def self.() result = { "xmlns:samlp" => NS_MAP["samlp"], "xmlns:saml" => NS_MAP["saml"], "ID" => Samlr::Tools.uuid, "IssueInstant" => Samlr::Tools::Timestamp.stamp, "Version" => "2.0" } result["InResponseTo"] = [:in_response_to] if [:in_response_to] result["Destination"] = [:destination] if [:destination] result end |