Skip to content

SAML SP metadata generator

Generate service provider metadata from an entity id, an ACS URL, a NameID format and a certificate, ready to give to an identity provider.

Runs in your browser. Nothing you paste is sent to us.

Service provider

Usually the URL of this metadata. In Keycloak it becomes the client id.

A throwaway sample certificate is filled in. Use your app’s own public certificate, never a private key.

Metadata

SP metadata XML
<?xml version="1.0" encoding="UTF-8"?>
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" entityID="https://app.example.com/saml/metadata">
  <md:SPSSODescriptor AuthnRequestsSigned="true" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
    <md:KeyDescriptor use="signing">
      <ds:KeyInfo>
        <ds:X509Data>
          <ds:X509Certificate>
            MIICsDCCAZgCCQDtTRSSC6cozzANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDDA9h
            cHAuZXhhbXBsZS5jb20wHhcNMjYxMTI1MDkzNjE3WhcNMzYxMTIyMDkzNjE3WjAa
            MRgwFgYDVQQDDA9hcHAuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB
            DwAwggEKAoIBAQDann9gmucCTuKQRmAmmoxhF87YzxKUS/CvJU//4ViZYTJHOtFS
            z81wXQW3nc2DZW8tbN/2u3UswZQUYaHYu1In53rXDd5gcDeN7/o9hcAhYTIMltIc
            JyM4OM/h/FEOoMF6dvTDjleO8P5u95sKqWrXiRhTtGKuqS2uK7mDJSCj1MSn3UEx
            YkTkb6f6nbza94f9ArWtTktb3ZR7z/j7bPJPj0cOKLZ3vsP97kCWO7CIDZM1OANB
            JBy2cZ/N8TYWWPBzVL01TEg2/+aWBF5tm6qQaI+nP9pzKppsebgrLZCyRk7FFud+
            k9NTIzPrqrxinTq48/V8FXk7WzK7hC/C+f07AgMBAAEwDQYJKoZIhvcNAQELBQAD
            ggEBAJVdGUKJlxZAxJRN26eH+LB3rmyPsZXqM/DDGsCbRPsXCMPlDKhEC3qhohu+
            BgmvLjEuoJZO4qkf2a/4ay9iRPC+uQbUwMmXGvG+tsdZlyliZ+p646ARHRTC1aUG
            a80G274vqXp4hUuKOJ9DPvYt3uX9oF6g9JQXx69m4+QoA3XaTvN2L6oT37FvjNhe
            9nEn4laRd6Wg+zn40Be3omy/0eFMBgHYJ7WtHCvYQ1peWBwyupGjSXoMWIX1pZ2e
            BBdbHXQZivHvrwphqDqw9pdkWmXo9IiEJTBkkPvyS/vw3c2RaWvcU9EWI6Xbv5Ih
            SoYLdJNypSG+JY97ffEHFcTSj3s=
          </ds:X509Certificate>
        </ds:X509Data>
      </ds:KeyInfo>
    </md:KeyDescriptor>
    <md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://app.example.com/saml/logout"/>
    <md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</md:NameIDFormat>
    <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://app.example.com/saml/acs" index="0" isDefault="true"/>
  </md:SPSSODescriptor>
</md:EntityDescriptor>
The metadata is not signed. Serve it over https, or sign it with your own tooling if the identity provider requires signed metadata.

How to use it

  1. Enter the app’s entity id and the URL where it receives SAML responses.
  2. Add a logout URL if the app supports single logout.
  3. Pick the NameID format and say whether the app signs requests and wants signed assertions.
  4. Paste the app’s public certificate, then copy the XML.

What to know

An identity provider needs to know three things about an app: its entity id, where to send responses (the assertion consumer service), and the certificate to check the app’s signatures with. Metadata carries all three in a standard form.

Keycloak can create a SAML client from this metadata: in the admin console, choose Import client and load the file. The entity id becomes the client id.

Only put a public certificate here. The private key stays with the app.

What service provider metadata is for

In SAML, the app is the service provider. Before an identity provider will sign users in to it, the identity provider must know three things: the app’s entity id, where to send responses, and which certificate the app uses. Service provider metadata is a standard XML document that carries all three, defined in the SAML 2.0 metadata specification.

Most identity providers can import it, which saves typing URLs and certificates into a console by hand and avoids the typos that come with it. Many SAML libraries generate it for you; this tool is for when yours does not, or when you want to see exactly what goes in it.

What goes in it

Service provider metadata (sample)
<md:EntityDescriptor entityID="https://app.example.com/saml/metadata">
  <md:SPSSODescriptor AuthnRequestsSigned="true" WantAssertionsSigned="true"
      protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
    <md:KeyDescriptor use="signing">
      <ds:KeyInfo><ds:X509Data>
        <ds:X509Certificate>MIICsDCCAZgCCQ…</ds:X509Certificate>
      </ds:X509Data></ds:KeyInfo>
    </md:KeyDescriptor>
    <md:SingleLogoutService
        Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
        Location="https://app.example.com/saml/logout"/>
    <md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</md:NameIDFormat>
    <md:AssertionConsumerService index="0" isDefault="true"
        Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
        Location="https://app.example.com/saml/acs"/>
  </md:SPSSODescriptor>
</md:EntityDescriptor>

Entity id

A URI that names the app. It is compared as an exact string everywhere: in requests as the Issuer, in assertions as the Audience, and at the identity provider as the app’s identifier. Using the metadata URL itself is a common choice because it is unique and easy to find.

Assertion consumer service

The URL where the app receives SAML responses, with a binding. For browser sign-in that is HTTP-POST, or HTTP-Artifact if the app resolves artifacts. The index and isDefault attributes let an app list more than one.

Single logout service

Optional. The URL where the app receives logout requests and responses, if it supports single logout.

NameID format

Optional. The identifier formats the app accepts. If you list one, the identity provider knows what to send. See the NameID format reference.

Keys and flags

A signing certificate lets the identity provider check signed requests. An encryption certificate lets it encrypt assertions for the app. AuthnRequestsSigned says the app signs its requests; WantAssertionsSigned says the app wants signed assertions.

Element order matters

The metadata schema fixes the order of elements inside SPSSODescriptor: keys first, then single logout services, then NameID formats, then assertion consumer services. Some importers are strict about this and reject documents in another order. The tool always writes the schema order.

What this tool does

Fill in the entity id, ACS URL and binding, an optional logout URL and binding, a NameID format, the two signing flags and an optional certificate. The tool writes the metadata as you type. It checks that URLs are absolute, that the certificate is Base64 and reads as X.509, and that signed requests come with a certificate. It warns about plain http endpoints.

It escapes every value for XML, wraps the certificate in a KeyDescriptor with use="signing", and can publish the same certificate for encryption too.

What it does not do

It does not sign the metadata, generate keys, or add organization and contact details. It never asks for a private key: metadata only ever holds public certificates. To make a key pair for testing, use the RSA key pair generator and keep the private key with the app.

How to use it

  1. Decide the app’s entity id. Once an identity provider has it, changing it is a migration.
  2. Enter the ACS URL the app listens on, exactly as the browser will reach it, with https.
  3. Add the logout URL if the app supports single logout.
  4. Pick the NameID format the app expects, or none.
  5. Tick the flags that match the app, paste its public certificate, and copy the XML.
  6. Host the file at a stable URL, or send it to the identity provider’s administrator.

Use cases

Registering an app in Keycloak

Keycloak can create a SAML client from service provider metadata. In the admin console, open Clients and choose Import client, then load the file. The entity id becomes the client id, and settings such as the ACS and logout URLs and the signing certificate are taken from the metadata. Check the result before you save, then give the app the realm descriptor URL in return.

Onboarding with an enterprise customer

When you sell an app to a company that uses its own identity provider, their administrator usually asks for your metadata. Generate one document per environment, such as staging and production, each with its own entity id and URLs, so the two never get mixed up.

Moving an app to a new domain

A domain move changes the ACS and logout URLs, and often the entity id. To move without downtime, publish metadata that lists both ACS URLs, with the new one as default, and have the identity provider import it. Switch the app to the new domain, then remove the old URL. If the entity id changes too, the identity provider sees a new app: register it next to the old one and switch users over in one step.

Testing a new SAML integration

Before the app’s SAML library is wired up, you can register its metadata at a test identity provider, then use the SAML redirect URL builder to send a request and the SAML response decoder to read what comes back.

Common mistakes

  • An ACS URL that differs from what the app checks, such as http behind a TLS proxy or a missing path prefix.
  • Different entity ids in the metadata and in the app’s configuration.
  • Pasting a private key instead of the certificate.
  • Setting AuthnRequestsSigned without giving a certificate.
  • Reusing one entity id for staging and production.

Security notes

Metadata is public. It should hold only public certificates, never keys or secrets. Serve it over https so nobody can change the ACS URL or certificate on the way to the identity provider. If the identity provider requires signed metadata, sign it with your own tooling after generating it.

Best practices

  • Use https for every endpoint.
  • Sign requests and ask for signed assertions.
  • Use separate keys for signing and encryption if your library supports it.
  • Publish the metadata at a stable URL so the identity provider can refresh it.
  • List only the bindings and formats the app really supports.

Hosting the metadata

Identity providers that refresh metadata need a stable URL to fetch it from. Serve the file from the app itself or a static host, over https, with the content type application/samlmetadata+xml or plain application/xml. Many teams make the entity id and the metadata URL the same string, so anyone holding the entity id can find the metadata.

Keep the URL public and unauthenticated. The file contains only public information, and an identity provider cannot sign in to fetch it. When you change a certificate or an endpoint, change the hosted file first, then tell the identity provider’s administrator so they can refresh it if their side does not do so on its own.

More than one ACS URL

An app can list several AssertionConsumerService elements, for example one per binding or one per host name during a domain move. Each has an index, a number unique within the descriptor, and one may be marked isDefault="true".

A request can then pick one, either by URL with AssertionConsumerServiceURL or by number with AssertionConsumerServiceIndex. Without either, the identity provider uses the default, or the first one listed. This tool writes one endpoint with index 0 as the default; add more by hand if you need them, keeping each index unique.

Questions

Frequently asked questions

What is SAML SP metadata?

An XML document that describes a SAML service provider: its entity id, assertion consumer service URL, optional logout URL, NameID formats and certificates. Identity providers import it to register the app.

What should my SAML entity id be?

Any URI unique to the app. The URL of the app’s metadata is a common choice. It is compared as an exact string, so keep it identical everywhere.

What is the ACS URL in SAML?

The assertion consumer service URL is where the app receives SAML responses. The identity provider posts the response there through the browser.

Do I need a certificate in SP metadata?

Only if the app signs requests or wants encrypted assertions. Without one, the identity provider cannot check the app’s signatures or encrypt for it.

Can Keycloak import SP metadata?

Yes. In the admin console, Clients, Import client accepts a SAML entity descriptor and fills in the client settings from it.

Does SP metadata need to be signed?

Not by the standard. Some identity providers and federations require signed metadata; others accept unsigned metadata over https.

What is the difference between AuthnRequestsSigned and WantAssertionsSigned?

AuthnRequestsSigned says the app signs the requests it sends. WantAssertionsSigned says the app wants the assertions it receives to be signed.

Where should I host SP metadata?

At a stable, public https URL, often the entity id itself. Identity providers that refresh metadata fetch it from there without signing in.

Can SP metadata list more than one ACS URL?

Yes. Each AssertionConsumerService has its own index, and one can be marked isDefault. A request can then pick one by URL or by index.

How do I update my app’s metadata at the identity provider?

If the identity provider refreshes from your metadata URL, update the hosted file. Otherwise send the new file to its administrator, or update the client in Keycloak by hand.

Rather not run Keycloak yourself?

We run it for you on a cluster of your own, with backups, upgrades and written support. Starter and Premium begin with a 7-day trial.