SAML decoder

Decode a SAMLRequest or SAMLResponse from a login URL or a POST form, see the formatted XML and a summary (issuer, audience, NameID, attributes

loading SAML decoder
About this tool

What is a SAML decoder?

SAML 2.0 is the protocol behind many corporate single sign-on logins. When you click "Sign in with your company account", your browser carries an XML message between the application (the service provider) and the identity provider: an authentication request on the way out, and a response with the user's identity on the way back. The XML is not sent as readable text. In the HTTP-Redirect binding it is compressed with raw DEFLATE, written in Base64 and URL-encoded, and placed in a SAMLRequest or SAMLResponse parameter of the address. In the HTTP-POST binding it is only Base64 inside a hidden form field.

When a login fails, the first question is always "what did the message say?". This tool answers it. Paste the whole URL, only the value of the parameter, or the Base64 copied from the browser's network panel, and it detects which binding you have, inflates it when needed and shows the XML formatted and colored. Next to it you get a summary of the fields people look for: the message type, the Issuer, the Destination and the assertion consumer URL, the audience restrictions, the NameID and its format, the attributes with all their values, the validity window (NotBefore and NotOnOrAfter, marked valid, expired or not yet valid against your clock), the authentication context, the session index and the status code.

It also works backwards. Paste XML and get the value to put in a redirect URL (deflate, Base64 and URL encoding) or the Base64 for a POST form, which is handy when you write a test request by hand.

One limit matters. The tool only reports whether a ds:Signature is present and which algorithms it declares. It does not verify the signature, so a signature shown here is never a proof of anything. Verifying needs the identity provider's certificate and exclusive canonicalization of the signed element, which is a job for your SAML library. Everything runs in the browser and nothing you paste is sent or stored.

How to read a SAML message

  1. Open the page. It starts with a sample login request in a URL, so you can see the result right away.
  2. Replace it with your own message. Copy the full URL from the address bar or the network panel, or only the value after SAMLRequest= or SAMLResponse=. For a POST, copy the Base64 from the form field.
  3. Check the line under the XML: it says which binding was detected.
  4. Read the summary below. Look first at the Issuer, the Destination and the audience, then the validity status, then the attributes.
  5. To build a value, switch to Encode, paste the XML and choose the target: redirect with URL encoding, redirect before URL encoding, or POST.

Examples

A login request in a URL

https://idp.example.com/sso?SAMLRequest=fVJN...&RelayState=%2Fdashboard

The tool reads the parameter, inflates it and shows an AuthnRequest, with the issuer of the application and the URL where the response must be sent.

A response that expired

The summary shows the Conditions window and the badge "expired". A common cause of "login works for some people only" is a clock that is minutes off, which makes a response arrive before NotBefore or after NotOnOrAfter.

Attributes that do not arrive

The attributes table lists every Attribute with its name, friendly name and all values. If the application expects email and the identity provider sends mail, it shows up here.

A wrong audience

The Audience in the assertion must be the application's entity ID exactly. A trailing slash is enough to make the application reject the login.

Common mistakes

  • Pasting a URL-decoded value. Base64 uses +, and a plus sign turned into a space breaks the data. The tool repairs that, but copy from the original source when you can.
  • Cutting the value. A truncated parameter gives a Base64 or inflate error. Copy it again in full.
  • Reading the dates in local time. SAML dates are in UTC. The badge compares them with your clock, so a wrong clock shows wrong results.
  • Trusting a message because it has a signature. Present is not valid. Verify with your SAML library or identity provider tools.
  • Looking for data in an encrypted assertion. When the assertion is encrypted, only an EncryptedAssertion element is visible. The content is for the service provider's private key.
  • Mixing up the bindings. A POST value is not compressed. If you try to inflate it by hand it fails; the tool picks the right path.

Frequently asked questions

Is it safe to paste a SAMLResponse here?

A response can carry personal data and is a login credential while it is valid. This page decodes it only in your browser and never sends it, but prefer expired messages or test accounts, as with any credential.

Does it check the signature?

No. It only tells you whether a signature element exists and which algorithms it names. It does not verify the digest or the signature value.

What is the difference between redirect and POST?

Redirect puts the message in the URL, compressed, so it can be copied from the address bar. POST sends it in a form body, not compressed, and is the usual way for responses, which are larger.

Can I look at a JWT instead?

OpenID Connect logins use JWTs. For those use the JWT parser. To look at the Base64 of anything else, use the Base64 tool.

Can I see the XML in more detail?

Send the decoded XML to the XML formatter to minify it, or to the URL parser to inspect the full address.

Report a problem