Skip to content

SAML request decoder

Paste a redirect URL or a SAMLRequest value to read the request inside: who sent it, where the response should go, and which NameID format it asks for.

Runs in your browser. Nothing you paste is sent to us.

SAML request

A sample redirect URL to a sample Keycloak realm is filled in. Paste the whole URL, the query string, or only the SAMLRequest value, URL-encoded or not.

Decoded

XML
 

How to use it

  1. Copy the URL the app sends you to when you click sign in, or only its SAMLRequest value.
  2. Paste it here. URL-encoded or not, the tool finds and decodes the value.
  3. The tool inflates it when it was deflated (redirect binding) or reads plain Base64 (POST binding).
  4. Check the issuer, the ACS URL and the NameID policy against the client’s settings.

What to know

With the HTTP-Redirect binding, the request is compressed with raw DEFLATE, Base64-encoded and put in the URL as SAMLRequest. With the HTTP-POST binding it is only Base64-encoded and posted in a form. This tool tries both.

In Keycloak, the request’s Issuer must equal the client id of a SAML client in the realm, or Keycloak refuses it with Unknown login requester. The ACS URL in the request must match one the client allows.

A signed redirect request carries SigAlg and Signature as separate URL parameters; the signature covers the query string, not the XML. The tool lists them but does not check them.

What a SAML request is

A SAML request is a message an app sends to an identity provider to ask for something. The most common one is the AuthnRequest: please sign this user in and send me an assertion. Others include LogoutRequest, used for single logout, and ArtifactResolve, used with the artifact binding.

Requests are defined in SAML 2.0 core. How they travel is defined in the bindings specification. For sign-in from a browser, the app usually redirects the user to the identity provider with the request in the URL, or posts it there in a form.

Reading the request is often the fastest way to understand a failed sign-in. It shows who the app claims to be, where it wants the answer sent, and what it asks for.

How the request travels

The same XML is encoded differently for each binding. This tool detects which encoding was used.

HTTP-Redirect binding

The XML is compressed with raw DEFLATE (RFC 1951, with no zlib header), then Base64-encoded, then URL-encoded. It goes into the query string as SAMLRequest, optionally followed by RelayState. If the request is signed, two more parameters follow: SigAlg and Signature.

Redirect binding URL (shortened sample)
https://auth.example.com/realms/acme/protocol/saml
  ?SAMLRequest=fZJBT8MwDIXv%2BxVR7m26IkBEa6WyCVFpQMUG…
  &RelayState=%2Fdashboard

HTTP-POST binding

The XML is Base64-encoded but not compressed, and sent as a hidden form field named SAMLRequest. Because a form body has no practical size limit, POST is also used for large or signed requests that carry an XML signature inside the message.

What is inside an AuthnRequest

Sample AuthnRequest (made up)
<samlp:AuthnRequest ID="_7f3c9a" Version="2.0"
    IssueInstant="2026-11-25T10:00:00Z"
    Destination="https://auth.example.com/realms/acme/protocol/saml"
    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:2.0:nameid-format:persistent"
      AllowCreate="true"/>
</samlp:AuthnRequest>
PartWhat it means
IDA unique id. The response echoes it as InResponseTo.
IssuerThe app’s entity id. The identity provider uses it to find the app.
DestinationThe identity provider endpoint the request was sent to.
AssertionConsumerServiceURLWhere the app wants the response. It must be a URL the identity provider allows for this app.
ProtocolBindingHow the app wants the response delivered, usually HTTP-POST.
NameIDPolicyThe NameID format the app wants, and whether a new identifier may be created.
ForceAuthnWhen true, the user must sign in again even with a live session.
IsPassiveWhen true, the identity provider must not show any sign-in screen.
RequestedAuthnContextHow strongly the user must be authenticated.

What this tool does

Paste a whole redirect URL, a query string, a form body, or only the SAMLRequest value. URL-encoded or not, the tool finds the value, Base64-decodes it, and then either reads it as XML (POST binding) or inflates it first (redirect binding). It tells you which one it found.

For an AuthnRequest it lists the issuer, ACS URL, response binding, NameID policy, ForceAuthn, IsPassive and requested authentication context. For a LogoutRequest it shows the NameID and session index. Any RelayState, SigAlg and Signature parameters are listed too.

What it does not do

It does not check signatures. A redirect binding signature covers the query string, and checking it needs the app’s certificate. It does not send the request anywhere or follow any URL inside it.

Inflating uses the browser’s own DecompressionStream with the deflate-raw format. Current versions of Chrome, Edge, Firefox and Safari support it; the tool says so if your browser does not.

How to capture a request

  1. Open developer tools and the Network tab, and turn on Preserve log.
  2. Click the app’s sign-in button.
  3. Find the request to the identity provider. For the redirect binding it is a GET with SAMLRequest in the URL. For POST, it is a form POST with SAMLRequest in the payload.
  4. Copy the full URL or the value and paste it into the tool.
  5. Compare the issuer, ACS URL and NameID policy with how the app is set up at the identity provider.

SP-initiated and IdP-initiated sign-in

In SP-initiated sign-in, the user starts at the app. The app sends an AuthnRequest, and the response comes back with InResponseTo set to the request’s ID. This is the flow you can debug with this tool.

In IdP-initiated sign-in, the user starts at the identity provider, for example from a portal. There is no request at all, and the response has no InResponseTo. If an app only accepts responses to its own requests, IdP-initiated sign-in fails for it. In Keycloak, IdP-initiated sign-in to a SAML client needs the client’s IDP-Initiated SSO URL name to be set.

Using it with Keycloak

A Keycloak realm accepts SAML requests at https://<host>/realms/<realm>/protocol/saml for both bindings. Keycloak finds the client by the request’s Issuer, which must equal a SAML client’s client id. If no client matches, Keycloak shows an error page instead of a sign-in form.

Signed requests

When the client has Client signature required on, Keycloak checks the request signature with the certificate stored under the client’s Keys tab. A request without a signature, or signed with another key, is refused. Check that SigAlg and Signature are present in the URL, or that a ds:Signature element is inside the XML for POST.

The ACS URL

If the request names an AssertionConsumerServiceURL, Keycloak sends the response there only if that URL is allowed for the client. The client’s ACS URL settings and valid redirect URIs decide what is allowed. Mismatches here often show up after an app moves to a new domain.

Keycloak as the app

When Keycloak brokers sign-in to another SAML identity provider, Keycloak itself sends the AuthnRequest. Decoding it shows the service provider entity id, NameID policy and ACS URL that Keycloak uses for that identity provider, which is what the other side must have configured.

Common problems and fixes

SymptomLikely causeFix
Identity provider says the app is unknownIssuer does not match any registered appMake the entity id identical on both sides, including any trailing slash
Value decodes to unreadable bytesIt was deflated (redirect binding)Inflate after Base64; this tool does it
Inflating failsValue was cut off or uses zlib or gzip instead of raw DEFLATECopy the whole parameter; fix the app to use raw DEFLATE
Signature rejectedWrong key, or the query string was rebuilt in a different orderSign the exact SAMLRequest, RelayState, SigAlg string the binding defines
InvalidNameIDPolicy in the responseRequested NameID format is not allowedAsk for a format the identity provider supports, or allow it there

A + in Base64 must be sent as %2B in a URL. Some tools turn an unencoded + into a space, which breaks the value. This tool keeps + as it is.

Security notes

  • A request is not secret, but it reveals the app’s entity id and endpoints. That is normally public metadata anyway.
  • An identity provider must only send responses to ACS URLs registered for the app. Otherwise an attacker could ask for the response to be sent to their own site.
  • Signed requests stop others from making requests in the app’s name, which matters when the request asks for something special such as a different ACS URL.

Best practices

  • Register exact ACS URLs at the identity provider. Avoid wildcards.
  • Use the same entity id string everywhere: in metadata, in the app and in the identity provider.
  • Sign requests when the identity provider supports it, with SHA-256 or stronger.
  • Keep RelayState short; the bindings limit it to 80 bytes.

Logout requests

Single logout uses the same bindings as sign-in, so the decoder reads logout messages too. A LogoutRequest names the user with the same NameID the assertion carried, and the SessionIndex from the assertion’s AuthnStatement. The receiver uses both to find the session to end.

When logout fails, compare these two values with the ones in the original assertion. A NameID in another format, or a missing session index, is enough for the other side to find no session. Most identity providers also require logout requests to be signed, since an unsigned one could end someone else’s session.

Questions

Frequently asked questions

How do I decode a SAMLRequest?

URL-decode it if needed, then Base64-decode it. If the result is not readable XML, it was sent with the redirect binding and is compressed: inflate it with raw DEFLATE. The tool does all three steps.

Why is my decoded SAMLRequest unreadable?

The redirect binding compresses the XML before Base64. Decoding Base64 gives you compressed bytes, not XML. Inflate them with raw DEFLATE, not zlib or gzip.

What is the difference between the SAML redirect and POST bindings?

The redirect binding puts the deflated, Base64-encoded message in the URL. The POST binding puts the Base64-encoded message, uncompressed, in a form that the browser submits. POST suits larger messages and messages with an XML signature inside.

What is AssertionConsumerServiceURL in an AuthnRequest?

It is the address where the app wants to receive the SAML response. The identity provider must check that it is registered for the app before using it.

What do ForceAuthn and IsPassive mean?

ForceAuthn asks the identity provider to authenticate the user again even if a session exists. IsPassive asks it not to interact with the user at all; if sign-in is not possible silently, it returns a NoPassive status.

Can I decode a SAML LogoutRequest with this tool?

Yes. Logout requests use the same bindings. The tool shows the NameID and SessionIndex, which tell the other side which session to end.

Where are SigAlg and Signature in a redirect request?

They are separate query parameters after SAMLRequest and RelayState. The signature covers those parameters as a string, not the XML, so the XML itself carries no ds:Signature.

Rather not run Keycloak yourself?

We run it for you on a cluster of your own, with backups, upgrades and written support. Starter and Premium begin with a 7-day trial.