SAML Decoder
Decode SAML responses and assertions.Runs in this tab.⌘ ↵ runs it
How to use SAML Decoder
- Paste a Base64 SAML request or response into Encoded SAML. A Redirect-binding value can stay URL-encoded. The same box handles both.
- Leave Auto-inflate (decompress deflated SAML) on unless you already know the message is Base64 only. Turn it off to skip the inflate attempt.
- Read Decoded XML. If inflate fails, the decoder shows the Base64-decoded bytes instead.
POST binding vs Redirect binding
SAML messages pass through the browser in one of two encodings. What you paste depends on which one you captured:
| Binding | Where it appears | Encoding |
|---|---|---|
| HTTP-POST | SAMLResponse field of an auto-submitting form, POSTed to the SP’s ACS URL |
Base64 |
| HTTP-Redirect | SAMLRequest query parameter on the redirect to the IdP, plus logout messages |
Raw DEFLATE, then Base64, then URL-encoding |
Login responses arrive by POST (or, rarely, the Artifact binding), because the Web Browser SSO profile forbids Redirect for them. AuthnRequests and logout messages often go via Redirect.
One setting handles both. With Auto-inflate on (the default), the decoder:
- URL-decodes the input if it contains
%. - Base64-decodes it.
- Tries raw DEFLATE, falling back to the plain decoded bytes if that fails.
- Indents the resulting XML.
Line-wrapped Base64 is fine. Here’s a Redirect-binding value copied straight from the URL (truncated):
fZJLT8MwEIT%2FSuR7XkWAsJJIoRWiUoGoDRy4oCVZWkt%2BBO8Gyr8nTUEtB3qdnc%2Bzo3VGYHQny543donvPRIHW6MtyXGQi95b6YAUSQsGSXIjV%2BXd…
It decodes to:
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_a91c3e" Version="2.0" IssueInstant="2026-11-01T17:02:05Z" Destination="https://idp.example.org/sso" AssertionConsumerServiceURL="https://app.example.com/saml/acs" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST">
<saml:Issuer>
https://app.example.com/saml/metadata
</saml:Issuer>
<samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" AllowCreate="true"/>
</samlp:AuthnRequest>
Gotchas:
- Paste only the parameter value. If you include the whole URL or a trailing
&RelayState=…, the Base64 step fails. - Binary garbage means the data is still compressed. Turn Auto-inflate back on. If the output is still garbage and starts with
x, the sender used zlib-wrapped deflate instead of the raw DEFLATE the spec calls for. Python’szlib.decompress(data)(without-15) reads that format. - The formatter puts element text on its own indented line, like the
Issuerabove. Trim the whitespace when you copy a value to compare it with your config. - Don’t verify signatures against this view. Re-indenting changes whitespace that the XML signature covers, so use the raw decoded bytes.
<saml:EncryptedAssertion>means the assertion is encrypted to the SP’s key. This tool doesn’t decrypt it, so check the SP’s logs or the IdP’s logs instead.
Capturing the SAMLResponse
Open the Network tab in DevTools and enable Preserve log (in Firefox, Persist Logs in the Network settings). You need it because the POST to the ACS URL is followed immediately by a redirect that clears the list. Sign in, find the POST to your ACS endpoint, and copy SAMLResponse from the Payload tab (the Request tab in Firefox). The decoder accepts both the parsed value and the URL-encoded one. The SAML-tracer extension for Firefox and Chrome logs and decodes every SAML message in a flow, which helps when several redirects are involved.
Fields to check when SSO fails
| Field | Must match | Typical error |
|---|---|---|
Response/@Destination, SubjectConfirmationData/@Recipient |
The SP’s ACS URL exactly, including scheme, port and trailing slash | Invalid destination or recipient |
Issuer |
The IdP entity ID configured at the SP | Unknown issuer |
Audience |
The SP’s entity ID | Audience restriction failed |
Conditions/@NotBefore, @NotOnOrAfter |
Current UTC time, within the SP’s allowed clock skew | Not yet valid / expired |
@InResponseTo |
The ID of the AuthnRequest the SP sent (absent for IdP-initiated logins) | Unsolicited response |
StatusCode/@Value |
urn:oasis:names:tc:SAML:2.0:status:Success |
Requester or Responder. The nested code (e.g. InvalidNameIDPolicy) gives the reason |
NameID and its Format |
What the SP looks users up by (emailAddress, persistent…) |
Wrong or duplicate account |
ds:X509Certificate |
The signing certificate the SP has on file | Bad signature after the IdP rotates its certificate |
SAML timestamps are always UTC, so compare them with date -u +%Y-%m-%dT%H:%M:%SZ, not your local clock. The SubjectConfirmationData/@NotOnOrAfter window is usually a few minutes, so a captured response you replay later will fail. The SSL certificate decoder accepts the bare Base64 from X509Certificate and shows its subject and expiry.
Command-line equivalent
# HTTP-POST: Base64 only
printf '%s' "$SAMLResponse" | base64 -d | xmllint --format -
# HTTP-Redirect: URL-decode, Base64-decode, raw inflate (-15 = no zlib header)
python3 -c 'import sys, zlib, base64, urllib.parse as u; print(zlib.decompress(base64.b64decode(u.unquote(sys.argv[1])), -15).decode())' "$SAMLRequest"
# Pull out one field
printf '%s' "$SAMLResponse" | base64 -d | xmllint --xpath 'string(//*[local-name()="Conditions"]/@NotOnOrAfter)' -
Use unquote, not unquote_plus. + is a valid Base64 character, and turning it into a space corrupts the data.
Keep assertions on your machine
A SAML response contains names, email addresses and group memberships. Until its NotOnOrAfter time passes, a captured bearer assertion may also be replayable. This decoder runs entirely in the page using the browser’s atob and DecompressionStream, and makes no network request with your input. Use it or the commands above rather than a server-side decoder, and scrub real values before you paste XML into a ticket. If a parameter was URL-encoded twice, run it through the URL decoder once first. For OIDC ID tokens, use the JWT decoder.
Next step
Turn a click-through into an interactive demo
AtriumKit records your web app once in Chrome and turns every click into a step of a demo you can embed or share. There’s a free plan.
Try AtriumKit freeQuestions
How do I decode a SAML request online?
How do I decode a SAML response?
What is SAML?
Where do I copy the encoded value from?
Comments
More in Encoding & Decoding
- Base64 Encoder / Decoder
- URL Encoder / Decoder
- HTML Entity Encoder / Decoder
- JWT Decoder
- Base32 Encoder / Decoder
- ROT13 Encoder / Decoder
- Morse Code Translator
- Binary to Text Converter
Comments