Skip to content

SAML response decoder

Paste a SAMLResponse to read who issued it, its status, the user’s NameID, the audience, the time limits and every attribute, with the decoded XML beside it.

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

SAML response

A made-up response from a sample Keycloak realm is filled in. Paste the SAMLResponse form value from your browser’s network tab; it stays in your browser.

Decoding does not verify the signature. The service provider must check it against the identity provider’s certificate.

XML

Decoded XML
 

How to use it

  1. In your browser’s developer tools, open the Network tab and sign in to the app.
  2. Find the POST to the app’s assertion consumer URL and copy the SAMLResponse form value.
  3. Paste it here. Base64, URL-encoded Base64 and plain XML all work.
  4. Read the status first, then the assertion: issuer, NameID, audience and attributes.

What to know

A SAML response is an XML document the identity provider posts to the app through the browser, Base64-encoded in a form field called SAMLResponse. It carries a status and, when sign-in worked, an assertion about the user.

From Keycloak, the issuer is the realm URL, https://<host>/realms/<realm>, and the audience is the client id of the SAML client, which is the app’s entity id. When the audience and the app’s entity id differ, the app refuses the response.

Decoding reads the XML; it does not prove who sent it. The app must check the signature against the identity provider’s certificate and check the times and audience before it trusts anything in the assertion.

What a SAML response is

A SAML response is the message an identity provider sends to an app after a sign-in attempt. It is defined in SAML 2.0 core as the samlp:Response element. It says whether sign-in worked and, if it did, carries one or more assertions about the user.

The app that receives it is the service provider. It reads the response at its assertion consumer service (ACS) URL. The browser carries the response from one side to the other, so the app and the identity provider never need to talk directly.

In the Web Browser SSO profile, the response travels with the HTTP-POST binding or the HTTP-Artifact binding. With POST, the identity provider returns an HTML form that the browser submits to the ACS URL. The form has a hidden field named SAMLResponse that holds the Base64-encoded XML, and often a RelayState field next to it.

What is inside a response

A response has a small envelope and the assertion inside it. Here is a shortened sample with made-up values:

Sample response (made up, shortened)
<samlp:Response ID="ID_41d2" Version="2.0"
    IssueInstant="2026-11-25T10:00:00Z"
    Destination="https://app.example.com/saml/acs"
    InResponseTo="_7f3c9a">
  <saml:Issuer>https://auth.example.com/realms/acme</saml:Issuer>
  <samlp:Status>
    <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
  </samlp:Status>
  <saml:Assertion ID="ID_9b07" Version="2.0" IssueInstant="2026-11-25T10:00:00Z">
    <saml:Issuer>https://auth.example.com/realms/acme</saml:Issuer>
    <ds:Signature>…</ds:Signature>
    <saml:Subject>
      <saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent">G-5c1e…</saml:NameID>
      <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
        <saml:SubjectConfirmationData Recipient="https://app.example.com/saml/acs"
            NotOnOrAfter="2026-11-25T10:05:00Z" InResponseTo="_7f3c9a"/>
      </saml:SubjectConfirmation>
    </saml:Subject>
    <saml:Conditions NotBefore="2026-11-25T10:00:00Z" NotOnOrAfter="2026-11-25T10:05:00Z">
      <saml:AudienceRestriction>
        <saml:Audience>https://app.example.com/saml/metadata</saml:Audience>
      </saml:AudienceRestriction>
    </saml:Conditions>
    <saml:AuthnStatement AuthnInstant="2026-11-25T10:00:00Z" SessionIndex="3e8f">…</saml:AuthnStatement>
    <saml:AttributeStatement>…</saml:AttributeStatement>
  </saml:Assertion>
</samlp:Response>

The envelope

  • Issuer: the entity id of the identity provider. From Keycloak it is the realm URL, https://<host>/realms/<realm>.
  • Destination: the URL the response was meant for. The app should check that it equals its own ACS URL.
  • InResponseTo: the ID of the request this answers. It is missing when the sign-in started at the identity provider.
  • Status: a top-level code such as Success, Requester or Responder, sometimes with a second-level code and a message.

The assertion

  • Subject holds the NameID, the user’s identifier, and a SubjectConfirmation that says who may present the assertion, where and until when.
  • Conditions sets the time window and the audience: the entity id of the app the assertion is for.
  • AuthnStatement says when and how the user signed in, plus a SessionIndex used later for logout.
  • AttributeStatement carries attributes such as name, email or roles.

What this tool does

The decoder accepts the SAMLResponse value as Base64, as URL-encoded Base64, or as plain XML. It decodes it, parses it with the browser’s XML parser, and shows the parts above as readable rows, with every time shown in UTC, in your local time and relative to now.

It also tells you whether a signature element is present on the response and on each assertion, whether the assertion is encrypted, and what the status means in plain words. The decoded XML is printed with indentation so you can read the rest.

What it does not do

It does not verify the signature. Checking an XML signature needs the identity provider’s certificate, canonicalization and a careful check of which element was signed. That is the job of the app’s SAML library.

It does not decrypt an EncryptedAssertion. Only the holder of the app’s private key can do that. It does not fetch anything either: the page makes no network requests with what you paste.

How to get the response from your browser

  1. Open your browser’s developer tools and select the Network tab. Turn on the option to preserve the log, because the page changes during sign-in.
  2. Sign in to the app as usual.
  3. Find the POST request to the app’s ACS URL. It often ends in /acs, /saml or /sso.
  4. Open its payload or form data and copy the value of SAMLResponse.
  5. Paste it into the tool. If you copied it from the raw request body, it may be URL-encoded; the tool handles that.

A live response can sign a person in until it expires. Use a test account where you can, and do not paste responses into tools that send data to a server.

Debugging a failed login

Most SAML sign-in failures can be explained from the response alone. Read it in this order.

Check the status first

If the status is not Success, the identity provider refused, and the problem is on its side or in the request. Requester means the request was wrong. A second-level code narrows it down: InvalidNameIDPolicy means the app asked for a NameID format the identity provider will not send, and NoPassive means the app asked for a silent sign-in that was not possible. Use the SAML request decoder to read what the app asked for.

Then the audience and destination

The Audience must equal the app’s entity id, character for character. A missing trailing slash or http instead of https is enough to fail. The Destination and the Recipient must equal the ACS URL the app is listening on. When an app sits behind a proxy, it may compute its own URL wrongly and then reject a correct response.

Then the times

Compare NotBefore and NotOnOrAfter with the time the response arrived. If the window looks right but the app still says the assertion is expired or not yet valid, one of the clocks is wrong. The assertion time checker shows each limit against a time and clock skew you choose.

Then the subject and attributes

If sign-in works but the user lands in the wrong account or has no permissions, look at the NameID and the attributes. Apps often expect a specific NameID format and specific attribute names. The NameID format reference and the attribute name reference list the common ones.

Reading responses from Keycloak

When Keycloak is the identity provider, the issuer is the realm URL and the audience is the client id of the SAML client, which you set to the app’s entity id. The NameID comes from the client’s Name ID format setting, or from the format the app asked for when Force name ID format is off.

What is signed depends on two client settings. Sign documents signs the whole response. Sign assertions signs the assertion inside it. If the app checks the assertion signature and only the document is signed, the app rejects the response even though a signature is present. The decoder shows which of the two carries a signature.

Attributes come from the client’s mappers and client scopes. If an attribute the app needs is missing, add a mapper such as User Property or User Attribute and set its SAML attribute name to what the app expects. The SAML client generator builds the client settings to import.

When Keycloak is the service provider

Keycloak can also receive responses, when it brokers sign-in to another SAML identity provider. Then the response is posted to the broker endpoint of the realm, and Keycloak checks the signature, times, destination and audience before it creates or links the user. Decoding the response that reached Keycloak tells you whether the other identity provider sent what Keycloak expects.

Common errors and what they mean

What the app reportsWhat to check in the response
Signature validation failedWhich element is signed, and whether the app has the current certificate of the identity provider
Audience mismatch or invalid audienceAudience against the app’s entity id, exactly
Invalid destination or recipientDestination and Recipient against the ACS URL, including scheme, host and path
Assertion expired or not yet validNotBefore and NotOnOrAfter against the time it was used; then the clocks
InResponseTo does not matchWhether the sign-in started at the identity provider, or the app lost its stored request ID
User not found or wrong userNameID value and format, and the attribute the app matches on

Certificate rollover

Signature failures that start on a specific day, after months of working sign-ins, usually mean the identity provider started signing with a new key. The app still holds the old certificate. Compare the certificate in the identity provider’s current metadata with the one configured in the app. The certificate extractor prints both as PEM with fingerprints.

In Keycloak, a realm can hold more than one key. Only an active key signs; a passive key is published for verification only. Add the new key, give the app its certificate, then make the new key the one used for signing.

Security notes

  • An app must check the signature on exactly the element it then reads. Libraries that do not are open to signature wrapping, where an attacker adds an unsigned assertion next to a signed one.
  • An app must check audience, destination, recipient and the time limits, and must refuse a response it has already accepted once.
  • Decoding is not trust. A decoded response proves nothing about who made it.
  • Responses contain personal data. Treat them like logs with user data in them.

Best practices for SAML apps

  • Sign assertions, and also responses if the app supports it.
  • Use SHA-256 or stronger signatures. Avoid SHA-1.
  • Keep clocks synced with NTP on both sides and allow only a small clock skew.
  • Use a persistent NameID or a stable attribute to identify users, not an email address that can change.
  • Encrypt assertions when they pass through systems you do not control, such as logging proxies.
Questions

Frequently asked questions

How do I decode a SAML response?

Copy the SAMLResponse form value from the POST to the app’s ACS URL and Base64-decode it. The result is XML. With the HTTP-POST binding the value is not compressed, so no inflating is needed.

Where do I find the SAML response in Chrome?

Open developer tools, select Network and turn on Preserve log. Sign in, then select the POST request to the app’s ACS URL and look in its payload for SAMLResponse.

Does decoding a SAML response check its signature?

No. Decoding only turns Base64 into XML. Verifying the signature needs the identity provider’s certificate and an XML signature library, which the app uses.

Why is my SAML assertion encrypted?

The identity provider was set to encrypt assertions for this app. The assertion appears as EncryptedAssertion and only the app’s private key can read it. In Keycloak this is the client’s Encrypt assertions setting.

What is the difference between a signed response and a signed assertion?

A signed response has a signature over the whole samlp:Response. A signed assertion has a signature over the saml:Assertion inside it. Apps check one or both, so the identity provider must sign what the app checks.

What does InResponseTo mean in a SAML response?

It is the ID of the AuthnRequest the response answers. The app compares it with the request it sent, which stops responses being replayed into other sessions. It is absent in IdP-initiated sign-in.

What does the Requester status code mean?

The identity provider found a problem with the request. A second-level status code such as InvalidNameIDPolicy, or a StatusMessage, usually says what. Decode the request to compare.

Is it safe to paste a SAML response into an online decoder?

Only into one that runs in your browser and sends nothing, like this one. A response holds personal data and may still be usable until it expires, so prefer test accounts and expired responses.

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.