SAML Decoder

Decode a SAMLRequest or SAMLResponse to readable XML, with issuer, NameID, conditions and attributes.

About SAML Decoder

A SAML decoder that turns an encoded SAMLRequest or SAMLResponse into readable XML and lists its issuer, NameID, conditions and attributes.

How to use

  1. Paste the value of the SAMLRequest or SAMLResponse parameter. A whole redirect URL, a form body or the XML itself also work; the parameter is picked out for you.
  2. The decoded XML appears on the right, indented. Switch to Original to see the XML exactly as it was sent.
  3. Read the summary: message type, transport, issuer, destination, status, NameID, audience, the NotBefore and NotOnOrAfter conditions, IDs and session index. Attributes are listed in their own table.
  4. The notes above the summary say whether the conditions have expired and which elements carry a signature.

What it does

SAML messages travel in two encodings, and the tool works out which one it has by looking at the bytes:

Binding Encoding Typical use
HTTP-Redirect raw DEFLATE, then Base64, then URL-encoding AuthnRequest and logout messages in a query string
HTTP-POST Base64 only Responses posted from a form
  • URL-encoding is removed first, including a value that was encoded twice. Line breaks inside the Base64 and the URL-safe alphabet are accepted.
  • Redirect-binding messages are inflated with the browser's built-in DecompressionStream.
  • Formatting only changes the whitespace between tags; the tags themselves are kept verbatim. Use the Original view when you are debugging a signature, because re-indented XML no longer matches its digest.
  • Attribute rows show the friendly name or the last part of a long claim URI; Copy gives the full names.
  • The expiry note compares the Conditions element with your device's clock. A real service provider usually allows a few minutes of clock skew.

What it does not do:

  • It does not verify the XML signature or the query-string signature of a redirect. It reports which elements are signed and shows the embedded X.509 certificate, which you can paste into the Certificate Decoder.
  • It cannot read an encrypted assertion; it tells you the assertion is encrypted and shows the rest of the message.
  • It does not validate the message against the SAML schema, and it rejects input over 2 MB.

Example

input   fZFLT8MwEIT/iuV7XuUh1UoihVaISgUiGjhwQSZZqCU/Uu8Gyr/HpCDa…

Message       AuthnRequest
Transport     Redirect binding (DEFLATE + Base64)
Issuer        https://sp.example.com/metadata
Destination   https://idp.example.com/sso
ACS URL       https://sp.example.com/acs
ID            _req42

Privacy

Decoding, inflating and formatting all run in JavaScript on this page. The message is not uploaded, no request is made, and nothing is stored.

Frequently asked questions

How do I decode a SAML response?
Copy the SAMLResponse value from the form post in your browser developer tools (Network tab, the request to the assertion consumer service) and paste it here. It is Base64-encoded XML, so the tool decodes it and shows the assertion, its conditions and its attributes.
Why is a SAMLRequest unreadable after Base64 decoding?
A SAMLRequest sent in a redirect URL is compressed with raw DEFLATE before it is Base64-encoded, so plain Base64 decoding gives binary data. It has to be URL-decoded, Base64-decoded and then inflated, which this tool does in one step.
Is it safe to paste a SAML response into an online decoder?
A SAML response holds personal data and, until its NotOnOrAfter time a few minutes after issue, can be replayed to log in. This tool decodes it in your browser without sending it anywhere, but treat any response from a production system as a credential and prefer test accounts.
What does NotOnOrAfter mean in a SAML assertion?
NotOnOrAfter is the instant at which the assertion stops being valid; a service provider must reject it at or after that time. Together with NotBefore it forms the validity window, which identity providers usually keep to a few minutes to limit replay.