SAML Decoder for Requests and Responses – Free

Paste a SAMLRequest, a SAMLResponse or a full sign-in URL and this SAML decoder shows the XML inside. Decoding runs locally, and signatures are not verified.

How to use the SAML decoder tool

  1. Choose HTTP POST or HTTP Redirect under Binding to match how the message was sent.
  2. Paste the encoded value, or the complete redirect URL, into Base64 message or SAML URL.
  3. Select Decode SAML. Select Example to decode a minimal assertion.
  4. Read the XML in the Result box and select Copy to move it into an XML formatter or editor.

How SAML messages are encoded

SAML 2.0 messages are XML documents, and the OASIS bindings specification defines how they travel through a browser. In the HTTP POST binding, the XML is Base64 encoded and placed in a hidden form field named SAMLResponse or SAMLRequest. Identity providers normally return responses and their assertions this way, because signed responses are too large for a URL.

In the HTTP Redirect binding, the XML is first compressed with raw DEFLATE (RFC 1951, with no zlib header), then Base64 encoded, then percent-encoded into a query parameter. Service providers commonly send AuthnRequest and LogoutRequest messages like this. The Binding option tells the tool whether to inflate the bytes after Base64 decoding.

Worked example for each binding

The first value is an uncompressed message for HTTP POST. The second is a complete redirect URL: the tool reads the SAMLRequest parameter, undoes the percent-encoding, decodes the Base64 and inflates the result.

Binding: HTTP POST
PHNhbWw6QXNzZXJ0aW9uIHhtbG5zOnNhbWw9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iLz4=

<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"/>

Binding: HTTP Redirect
https://idp.example.com/sso?SAMLRequest=HcmxCsIwEADQXwm3t16CLocRCl0Cuqg4uEgoAQvJpeYu4OcLvvUdJZa80dT1zdf06UnUfEtmoX946I2pRlmFOJYkpAvdpsuZ3Ii0tap1qRlMmD28ogXzSE3Wyh7ciGCCSE%2BBRSOrB4duP%2BBhQHu3jhAJ8Qm70w8%3D&RelayState=abc

<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_a1" Version="2.0" IssueInstant="2024-05-01T12:00:00Z"/>

Input the SAML decoder accepts

Encoded input may be up to 2,000,000 characters, and a Redirect message may inflate to at most 5 MB. The decoded bytes must be UTF-8. The XML is shown exactly as it was sent, on one line if the sender wrote it that way; the tool does not indent it. These input forms work:

  • A bare Base64 string copied from a form field or a network trace.
  • A percent-encoded value. If the input contains a percent sign, it is URL-decoded first.
  • A full http or https URL. The SAMLRequest parameter is used if present, otherwise SAMLResponse.
  • Base64 wrapped across several lines. Whitespace is removed before decoding.

What to look for, and what the tool does not do

In a response, compare Destination and Audience with your service provider's URLs, NotBefore and NotOnOrAfter with the clock, and the NameID format and attribute names with what your application expects. Mismatches in those fields are frequent causes of failed single sign-on.

The decoder is an inspection aid. It does not validate XML signatures, check certificates or decrypt an EncryptedAssertion, whose content stays as ciphertext. In the Redirect binding the signature is not inside the XML at all. It travels in separate Signature and SigAlg query parameters, which the tool ignores.

Frequently asked questions

Why do I get an error about invalid compressed data?

HTTP Redirect is selected but the message was not deflated. That is the normal case for a SAMLResponse posted to your assertion consumer service. Switch Binding to HTTP POST and decode again.

Why does HTTP POST fail on a SAMLRequest taken from a URL?

Requests sent in a query string are DEFLATE compressed, so the Base64 decodes to compressed bytes, not text, and the UTF-8 check fails. Select HTTP Redirect so the tool inflates the data before reading it.

Is it safe to paste a production SAML response?

The message is decoded in your browser and is not uploaded. A response does contain personal data such as names and email addresses, and an unexpired assertion could be replayed, so handle the decoded XML with the same care as the original.

Does the decoder verify the signature or certificate?

No. It only reverses the transport encoding. Signature validation needs the identity provider's signing certificate and an XML Signature implementation, which belongs in your SAML library, not in an inspection tool.

Can I paste the whole redirect URL?

Yes. When the input starts with http or https, the tool parses the query string and takes SAMLRequest, or SAMLResponse if there is no request parameter. RelayState, SigAlg and Signature are left out of the result.

How do I capture a SAML message to decode?

Open the browser developer tools, enable log preservation on the Network tab and sign in. For POST, find the request to the assertion consumer URL and copy the SAMLResponse form value. For Redirect, copy the request URL that contains SAMLRequest.

Related tools