Each SAML federation can have multiple service providers, for example PRIME Explorer Identity Manager, Smart ID Self-Service and any other application to be included in the federation. Each service provider must have a metadata file. For each service provider, do the following to create a metadata file: - Create a metadata file in .xml format, and give it a file name such as PRIME_Explorer_saml_metadata.xml.
- Open the file for editing. Copy and paste the example file content from below.
- Do the following changes:
- In entityID: enter a meaningful name for the service provider, for example https://prime.local/sp.
- Replace certificate data with the base64 encoded SAML certificate, for example prime.saml.pem.
- In Location: enter the location, for example http://localhost:8080/prime_explorer/saml/SSO/alias/explorer.
Code Block |
---|
language | xml |
---|
title | Example: Service Provider metadata file |
---|
| <?xml version="1.0" encoding="UTF-8"?>
<md:EntityDescriptor entityID="sp.example" xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata">
<md:SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" AuthnRequestsSigned="true" WantAssertionsSigned="false">
<md:KeyDescriptor use="signing">
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate>certificate data</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</md:KeyDescriptor>
<md:KeyDescriptor use="encryption">
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate>certificate data</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</md:KeyDescriptor>
<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</md:NameIDFormat>
<md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</md:NameIDFormat>
<md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</md:NameIDFormat>
<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md:NameIDFormat>
<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</md:NameIDFormat>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://localhost:8080/prime_explorer/saml/SSO/alias/explorer" index="0"/>
</md:SPSSODescriptor>
</md:EntityDescriptor> |
This table describes some elements and attributes of the Service Provider metadata xml file: Element | Attribute | Description |
---|
EntityDescriptor | The common root element for definitions of IDP and SP. |
| entityID | By convention, a symbolic URL can be used both for an IDP and a SP but any identifier is allowed. The number of characters is limited to 1024. |
| xmlns:md | Namespace definition of SAML V2.0 metadata. | KeyDescriptor | Provides information about the cryptographic key(s) an entity uses for signing and encryption. The contents, including the certificate, follow the XML Signature standard. |
| use | Allowed values are "signing" and "encryption". This attribute is optional. If it is not used the assumption is that the same certificate is used for both signing and encryption. | NameIDFormat | Elements indicate what SAML name identifier formats the service supports. | SPSSODescriptor: | Element for the definition of a SP. |
| protocolSupportEnumeration | Support for the SAML V2.0 protocol namespace. |
| AuthnRequestsSigned | Indicates if the SAML request sent by the SP must be signed. This attribute is optional. Defaults to "false" if not set. |
| WantAssertionsSigned | Indicates if the Assertion elements in the SAML response must be signed. This attribute is optional. Defaults to "false" if not set. | AssertionConsumerService | The service the SP defines to process the SAML response. |
| Binding | Mapping of the SAML protocol message onto a standard communication protocol. Value "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" required. |
| Location | The URI under which the endpoint is reachable. Must include the path /saml/SSO/alias/<alias>. |
| index | A unique integer of the endpoint for reference in a protocol message. |
|