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.
https://auth.example.com/realms/acme/protocol/saml
?SAMLRequest=fZJBT8MwDIXv%2BxVR7m26IkBEa6WyCVFpQMUG…
&RelayState=%2FdashboardHTTP-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
<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>| Part | What it means |
|---|---|
ID | A unique id. The response echoes it as InResponseTo. |
Issuer | The app’s entity id. The identity provider uses it to find the app. |
Destination | The identity provider endpoint the request was sent to. |
AssertionConsumerServiceURL | Where the app wants the response. It must be a URL the identity provider allows for this app. |
ProtocolBinding | How the app wants the response delivered, usually HTTP-POST. |
NameIDPolicy | The NameID format the app wants, and whether a new identifier may be created. |
ForceAuthn | When true, the user must sign in again even with a live session. |
IsPassive | When true, the identity provider must not show any sign-in screen. |
RequestedAuthnContext | How 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
- Open developer tools and the Network tab, and turn on Preserve log.
- Click the app’s sign-in button.
- Find the request to the identity provider. For the redirect binding it is a GET with
SAMLRequestin the URL. For POST, it is a form POST withSAMLRequestin the payload. - Copy the full URL or the value and paste it into the tool.
- 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
| Symptom | Likely cause | Fix |
|---|---|---|
| Identity provider says the app is unknown | Issuer does not match any registered app | Make the entity id identical on both sides, including any trailing slash |
| Value decodes to unreadable bytes | It was deflated (redirect binding) | Inflate after Base64; this tool does it |
| Inflating fails | Value was cut off or uses zlib or gzip instead of raw DEFLATE | Copy the whole parameter; fix the app to use raw DEFLATE |
| Signature rejected | Wrong key, or the query string was rebuilt in a different order | Sign the exact SAMLRequest, RelayState, SigAlg string the binding defines |
| InvalidNameIDPolicy in the response | Requested NameID format is not allowed | Ask 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
RelayStateshort; 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.