Debugging SAML Single Sign-On: Decode the Response First
How to capture and decode a SAML response or request, read assertions and conditions, check audience and recipient, and review IdP metadata certificates.

Debugging SAML Single Sign-On: Decode the Response First
SAML single sign-on tends to fail with unhelpful messages: "invalid response", "user not found", or a silent bounce back to the login page. The real reason is almost always written inside the SAML message itself, but that message travels as a long Base64 string. Decoding it is the first step of every SAML troubleshooting session. This guide shows how, using the free SAML Response and Metadata Decoder.
Capturing the message
With the HTTP-POST binding, the identity provider sends the response through the browser as a hidden form field called SAMLResponse. Open your browser's developer tools, switch to the Network panel, enable "preserve log", and sign in. Find the POST request to your service provider's Assertion Consumer Service URL and copy the SAMLResponse value from the form data.
Requests from the service provider usually travel with the HTTP-Redirect binding, as a SAMLRequest parameter in a URL. Copy the whole URL; the decoder pulls out the parameter, RelayState and SigAlg by itself. Redirect messages are compressed with raw DEFLATE before Base64, and the decoder inflates them automatically.
Reading a response
Paste the value and enter what your service expects: its entity ID, its ACS URL and the identity provider's entity ID. Leave the clock skew at a couple of minutes unless your library uses something else. The summary then answers the questions that matter:
- Status: anything other than Success means the identity provider refused, and the sub-status often says why, for example a requested authentication context it cannot satisfy.
- Destination and Recipient: must equal your ACS URL exactly, including scheme, host, port and path. A trailing slash or http instead of https is enough to fail.
- Audience: must contain your SP entity ID. A mismatch here is one of the most common configuration errors.
- NotBefore and NotOnOrAfter: the assertion is valid only inside this window. If your server clock is off by more than the allowed skew, valid responses are rejected.
- NameID and attributes: the user identifier and the values your application maps to email, name and groups. Missing attributes explain many "user not found" errors.
Signatures and algorithms
The decoder shows which elements are signed, which algorithms are used and which certificate is embedded. A response where neither the response nor the assertion is signed is an error. SHA-1 signatures and digests still appear in older setups and should be replaced with SHA-256.
It also looks for two patterns linked to signature wrapping attacks: a signature that references a different ID than the element it sits in, and assertions hidden in unexpected places. Seeing either in a real response warrants a closer look at your SAML library and its version.
The decoder does not verify signatures cryptographically. That requires exact XML canonicalisation, which belongs in your SAML library. Use the decoder to understand the message and your library to trust it.
Reviewing metadata
Paste an EntityDescriptor from either side to see entity IDs, endpoints and their bindings, NameID formats and signing preferences. Every certificate is decoded with its expiry date. Expired certificates are a classic cause of sudden SSO outages, often on a weekend, so the decoder flags certificates within 60 days of expiry. Plain-HTTP endpoints and an expired validUntil date are reported too.
Encoding test messages
The encode tab does the reverse: paste XML and get the Base64 value for an HTTP-POST form, or a complete Redirect query string with optional RelayState. This helps when you build test requests or reproduce a bug report.
Safe handling
SAML responses contain personal data and act as short-lived credentials. The decoder runs in your browser and does not upload anything, and its XML reader refuses documents with a DOCTYPE to avoid entity expansion tricks. Still, share captured responses only with people who need them, prefer expired ones in tickets, and clear the input when you are done.
A quick troubleshooting order
- Check the status.
- Compare audience, destination and recipient with your configuration.
- Check the validity window against your server clock.
- Confirm the expected attributes are present.
- Review signature algorithms and certificate expiry in the metadata.
Most SAML problems are found by step three.



