Class: SSOlo::Templates::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/ssolo/templates/metadata.rb

Overview

Renders the XML details of the Identity Provider

Class Method Summary collapse

Class Method Details

.call(request, certificate) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ssolo/templates/metadata.rb', line 7

def self.call(request, certificate)
  "    <?xml version=\"1.0\" encoding=\"utf-8\"?>\n    <EntityDescriptor xmlns=\"urn:oasis:names:tc:SAML:2.0:metadata\" entityID=\"\#{request.base_url}/saml\">\n      <IDPSSODescriptor protocolSupportEnumeration=\"urn:oasis:names:tc:SAML:2.0:protocol\">\n        <KeyDescriptor>\n          <ds:KeyInfo xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\">\n            <ds:X509Data>\n              <ds:X509Certificate>\n                \#{certificate.to_pem.lines.grep_v(/BEGIN CERTIFICATE|END CERTIFICATE/).join.strip}\n              </ds:X509Certificate>\n            </ds:X509Data>\n          </ds:KeyInfo>\n        </KeyDescriptor>\n        <SingleSignOnService Binding=\"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect\" Location=\"\#{request.base_url}/saml\" />\n      </IDPSSODescriptor>\n    </EntityDescriptor>\n  XML\nend\n"