What SAML metadata is
SAML metadata is an XML document in which a SAML party describes itself. It is defined in the SAML 2.0 metadata specification. Two parties that exchange metadata know each other’s entity ids, endpoints and certificates, which is everything they need to start exchanging messages.
Metadata replaces a long list of settings typed by hand. Instead of copying an SSO URL, a logout URL and a certificate from one console to another, you import one file or one URL. Most identity providers and SAML libraries can read it.
How a metadata document is built
The root is an md:EntityDescriptor with an entityID. Inside are one or more role descriptors. An identity provider has an IDPSSODescriptor; an app has an SPSSODescriptor. A federation that lists many parties wraps many entity descriptors in one md:EntitiesDescriptor.
<md:EntityDescriptor entityID="https://auth.example.com/realms/acme">
<md:IDPSSODescriptor WantAuthnRequestsSigned="true"
protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:KeyDescriptor use="signing">
<ds:KeyInfo><ds:X509Data>
<ds:X509Certificate>MIICmjCCAYICCQ…</ds:X509Certificate>
</ds:X509Data></ds:KeyInfo>
</md:KeyDescriptor>
<md:SingleLogoutService
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location="https://auth.example.com/realms/acme/protocol/saml"/>
<md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</md:NameIDFormat>
<md:SingleSignOnService
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location="https://auth.example.com/realms/acme/protocol/saml"/>
</md:IDPSSODescriptor>
</md:EntityDescriptor>Endpoints and bindings
Each endpoint names a binding and a location. An identity provider lists SingleSignOnService endpoints; an app lists AssertionConsumerService endpoints, each with an index and optionally isDefault. Both may list SingleLogoutService and ArtifactResolutionService endpoints.
Keys
A KeyDescriptor holds a certificate in ds:X509Certificate. Its use attribute is signing or encryption. When use is missing, the key serves both purposes. During a key rollover, metadata can list the old and the new certificate side by side.
Flags
WantAuthnRequestsSignedon an identity provider: it wants apps to sign their requests.AuthnRequestsSignedon an app: the app signs its requests.WantAssertionsSignedon an app: the app wants signed assertions.
Validity
validUntil is a date after which the metadata must not be trusted. cacheDuration is a hint for how long a copy may be kept before fetching it again. Both are optional.
What this tool does
Paste a metadata document and the tool shows the entity id, the validity, each role, every endpoint with its binding, the NameID formats, the flags and each key. For each certificate it shows the subject, the expiry date and the key type. Aggregates with many entities get a picker and a filter.
It warns when the metadata has expired, when a role does not list SAML 2.0 support, and when a role publishes no keys.
What it does not do
It does not fetch metadata from a URL. Open the URL in a browser tab, copy the XML and paste it. This keeps everything in your browser and avoids following links from a document you have not checked yet.
It does not check the metadata signature or validate the XML against the metadata schema. It shows whether a signature element is present.
How to use it
- Get the metadata: a URL from the identity provider or app, or a file someone sent you.
- Paste the XML into the tool.
- If it is an aggregate, filter by entity id and pick the entity you need.
- Copy the endpoints and check the keys and their expiry dates.
- To export the certificates as PEM with fingerprints, use the certificate extractor.
Use cases
Onboarding an enterprise customer’s identity provider
When a customer wants their staff to sign in to your app with their company identity provider, they usually send metadata. Read it to find their SSO URL, which bindings they accept, whether they want signed requests, which NameID formats they offer and when their signing certificate expires. Then send them your own app’s metadata in return.
Checking a Keycloak realm before sharing it
A Keycloak realm publishes its identity provider metadata at https://<host>/realms/<realm>/protocol/saml/descriptor. Before you give that URL to an app vendor, read it to confirm the host name is the public one, not an internal address. A wrong host name here usually means Keycloak’s hostname setting or the reverse proxy headers are not set correctly.
Debugging a failed connection
Many SAML errors are metadata mismatches: the app posts to an SSO URL that is not listed, or expects a binding the other side does not offer, or holds a certificate that is no longer in the metadata. Reading both sides’ metadata next to each other finds these quickly.
Keycloak as a broker
When Keycloak signs users in through another SAML identity provider, you can import that provider’s metadata when you add it in the admin console, instead of typing its URLs. Keycloak also publishes service provider metadata for that link, under the realm’s broker endpoint for the identity provider’s alias, which you give to the other side.
Reading the result
| You see | It means |
|---|---|
| Only HTTP-POST under single sign-on | Apps must post their requests; redirect-only apps cannot use it |
| No KeyDescriptor | Signatures cannot be checked from this metadata alone |
| Two signing certificates | Probably a key rollover; trust both until the old one is removed |
validUntil in the past | Software that honors it will refuse the metadata |
| Several ACS endpoints | The app can receive responses at more than one URL; isDefault marks the main one |
Common problems
- Entity id with or without a trailing slash: the two strings differ, and SAML compares them exactly.
- Metadata generated behind a proxy that shows
httpor an internal host in every location. - An expired signing certificate that the identity provider still uses. Many apps accept it, some do not.
- Metadata that was edited by hand after signing, which breaks its signature.
- An aggregate with thousands of entities where the one you need is missing because it is published in another feed.
Security notes
Metadata decides which certificates you trust. Get it over https from the party itself, or verify its signature when a federation signs it. A changed certificate in metadata should be expected and announced; if it is not, ask before you trust it.
Metadata is public by design. It contains no private keys, so publishing it is safe.
Best practices
- Refresh metadata on a schedule when both sides support metadata URLs, so key rollovers do not break sign-in.
- Keep entity ids stable. Changing one is a migration on both sides.
- Publish only the bindings you really support.
- Track certificate expiry dates and roll keys before they expire.
Exchanging metadata: URL or file
There are two ways to hand metadata to the other side, and they behave differently over time.
| Metadata URL | Metadata file | |
|---|---|---|
| Key rollover | The other side can fetch the new key itself, if it refreshes | Someone must send and import a new file |
| Endpoint changes | Picked up on the next refresh | Manual again |
| Network access | The other side must reach the URL | None needed |
| Trust | Comes from https and the host name | Comes from how the file was sent |
A URL is better when both sides support refreshing. Many products, however, read the URL once at setup and never again. Ask how the other side uses it before you rely on automatic rollover.
Aggregates and federations
Research and education federations publish one signed EntitiesDescriptor that lists all their members, often thousands of entities and many megabytes. Members fetch it regularly, check its signature with the federation’s certificate, and trust the entities in it.
Paste an aggregate into the tool to find one member: filter by part of its entity id, pick it, and read its endpoints and keys. For very large files, your browser needs a moment to parse them, but nothing is uploaded.
Entities in an aggregate often carry extensions, such as registration information or entity categories, in the md:Extensions element. The tool does not show them; open the XML for those.