How to use the saml request decoder
- Paste the
SAMLRequestparameter value into the input field. You can also paste the entire redirect URL. - The tool detects whether the input is a full URL, a URL-encoded value, redirect-binding data (Base64 plus raw DEFLATE) or POST-binding data (plain Base64 XML), and decodes it.
- It reverses the HTTP Redirect binding steps: URL decoding, base64 decoding and raw DEFLATE decompression.
- Review the extracted AuthnRequest fields such as ID, Issuer and Destination in the results table.
- Check the decoded XML output below the table to inspect the full request structure.
How the SAML Redirect Binding Works
The HTTP Redirect binding defined in the SAML 2.0 specification transmits requests via URL query parameters. Because URLs have length limits, the XML payload must be compressed before encoding. The process follows three steps:
- The AuthnRequest XML is compressed using the raw DEFLATE algorithm (RFC 1951), which omits the zlib header and checksum.
- The compressed bytes are encoded to base64.
- The base64 string is URL-encoded and appended as the
SAMLRequestquery parameter.
The HTTP POST binding skips compression and sends the XML as plain Base64 inside a form field. This saml request decoder handles both: it reverses those exact steps. It first extracts the parameter if you provide a full URL, then URL-decodes it, base64-decodes the result into bytes, and finally runs a pure TypeScript DEFLATE decompressor to recover the original XML.
Key AuthnRequest Fields Explained
Once the XML is recovered, several attributes carry the core meaning of the authentication request. Understanding these helps when debugging single sign-on flows.
| Field | Description |
|---|---|
ID | A unique identifier for this specific request, usually a UUID or random hex string. |
Version | The SAML protocol version, almost always 2.0. |
IssueInstant | The UTC timestamp when the service provider generated the request. |
Destination | The identity provider URL where the user is being redirected. |
AssertionConsumerServiceURL | The service provider endpoint that will receive the SAML response. |
Issuer | The entity ID of the service provider making the request. |
NameIDPolicy Format | The requested format for the subject identifier, such as urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress. |
The decoder extracts these fields automatically so you do not need to parse the XML manually.
Pure TypeScript DEFLATE Decompression
Most SAML tools rely on server-side libraries or browser APIs like DecompressionStream to handle DEFLATE. However, DecompressionStream requires asynchronous processing and is not available in all environments. This tool implements RFC 1951 entirely in synchronous TypeScript.
The DEFLATE format consists of blocks. Each block starts with a 3-bit header indicating whether it is the final block and which compression method is used: uncompressed, fixed Huffman, or dynamic Huffman. For dynamic blocks, the stream encodes custom code-length alphabets for both literal/length and distance codes. The decoder reads these trees, then processes symbols sequentially. Literal bytes are copied directly to the output. Length symbols indicate how many bytes to copy from a previous position, determined by a subsequent distance symbol. This back-reference mechanism is what achieves compression.
Because SAML uses raw DEFLATE rather than zlib or gzip, there is no two-byte header or Adler-32 trailer to strip. If you need to verify checksums separately, an Adler-32 calculator is available.
Common Errors When Decoding SAML Requests
Several issues frequently cause decoding failures when working with SAML redirect bindings:
- Double URL encoding: Some frameworks encode the parameter twice. If decoding fails, try passing the already-decoded base64 string directly.
- Zlib instead of raw DEFLATE: The SAML specification mandates raw DEFLATE. If the identity provider incorrectly wraps the payload in a zlib envelope (adding a header byte and Adler-32 checksum), standard raw inflate will fail.
- Truncated payloads: Web servers and proxies sometimes enforce URL length limits around 2,048 characters. If the base64 string is cut off, the DEFLATE stream will end unexpectedly.
- Wrong parameter: Ensure you are extracting
SAMLRequestand notSAMLResponse. Responses use a different flow and may not be deflated. Use the SAML decoder, which also reads responses, for those payloads.
When to Use a SAML Request Decoder
Identity provider administrators and service provider developers regularly need to inspect SAML traffic during integration. A saml request decoder is essential when configuring new applications, troubleshooting failed logins, or verifying that the correct NameID format and ACS URLs are being sent.
During initial setup, comparing the decoded AuthnRequest against the identity provider's expected configuration prevents hours of debugging. Security auditors also use these decoders to verify that requests include required extensions or that signature algorithms match organizational policies. For broader SAML message inspection, the general SAML decoder handles multiple message types, while specialized tools exist for certificates and signatures.
Worked examples
| Example | Input | Result |
|---|---|---|
| Redirect binding (URL-encoded) | SAMLRequest value or URL: fVLLTsMwEPyVyAduefYhYZKg0ApRqUDUFg5ckOssrSU%2FgteB8veYFNRyaK8zszsza%2BfIlGxp1bmtXsB7B%2BiCnZIaaU8UpLOaGoYCqWYKkDpOl9X9nGZRQltrnOFGkqOR8xMMEawTRpNgNi3IK0vXGR80QxiR4BkseqYgXuhpxA5mGh3TzkNJNg6TQZgOV8klzcZ0NHghwdSnFZq5fmrrXIs0jkXTRrBjqpUQGbuJEU1soREWuCNB9RdgYjR2CuwS7Ifg8LSYH1bgYQM3KmYcr3dFeuGRq68iI0H92%2FtG6EbozfnK670I6d1qVYf143JFyvznUrSvaMsTrgoca5hjeXwszvfv9eBtZtPaSMG%2FgltjFXOnU6RR2iOiCd96KQXFhKyaxgKiv4mU5nNigTkoiLMdkLjcu%2F7%2FGOU3 | Message type: AuthnRequest; Binding: HTTP-Redirect (Base64 + raw DEFLATE); ID: _a1b2c3d4e5; IssueInstant: 2026-03-14T09:26:53Z; Destination: https://idp.example.org/sso/redirect; AssertionConsumerServiceURL: https://sp.example.com/acs?x=1&y=2; ProtocolBinding: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST; Issuer: https://sp.example.com/metadata; NameIDPolicy: Format=urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress; AllowCreate=true |
| Full redirect URL | SAMLRequest value or URL: https://idp.example.org/sso?SAMLRequest=fVLLTsMwEPyVyAduefYhYZKg0ApRqUDUFg5ckOssrSU%2FgteB8veYFNRyaK8zszsza%2BfIlGxp1bmtXsB7B%2BiCnZIaaU8UpLOaGoYCqWYKkDpOl9X9nGZRQltrnOFGkqOR8xMMEawTRpNgNi3IK0vXGR80QxiR4BkseqYgXuhpxA5mGh3TzkNJNg6TQZgOV8klzcZ0NHghwdSnFZq5fmrrXIs0jkXTRrBjqpUQGbuJEU1soREWuCNB9RdgYjR2CuwS7Ifg8LSYH1bgYQM3KmYcr3dFeuGRq68iI0H92%2FtG6EbozfnK670I6d1qVYf143JFyvznUrSvaMsTrgoca5hjeXwszvfv9eBtZtPaSMG%2FgltjFXOnU6RR2iOiCd96KQXFhKyaxgKiv4mU5nNigTkoiLMdkLjcu%2F7%2FGOU3&RelayState=abc%3D1 | Message type: AuthnRequest; Binding: HTTP-Redirect (Base64 + raw DEFLATE); ID: _a1b2c3d4e5; IssueInstant: 2026-03-14T09:26:53Z; Destination: https://idp.example.org/sso/redirect; AssertionConsumerServiceURL: https://sp.example.com/acs?x=1&y=2; ProtocolBinding: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST; Issuer: https://sp.example.com/metadata; NameIDPolicy: Format=urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress; AllowCreate=true |
| POST binding (plain Base64) | SAMLRequest value or URL: PHNhbWxwOkF1dGhuUmVxdWVzdCB4bWxuczpzYW1scD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIiB4bWxuczpzYW1sPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9uIiBJRD0iX3Bvc3Q5ZjhlN2QiIFZlcnNpb249IjIuMCIgSXNzdWVJbnN0YW50PSIyMDI2LTAzLTE0VDA5OjI2OjUzWiIgRGVzdGluYXRpb249Imh0dHBzOi8vaWRwLmV4YW1wbGUub3JnL3Nzby9wb3N0IiBBc3NlcnRpb25Db25zdW1lclNlcnZpY2VVUkw9Imh0dHBzOi8vc3AuZXhhbXBsZS5jb20vYWNzP3g9MSZhbXA7eT0yIiBQcm90b2NvbEJpbmRpbmc9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpiaW5kaW5nczpIVFRQLUFydGlmYWN0Ij48c2FtbDpJc3N1ZXI+aHR0cHM6Ly9zcDIuZXhhbXBsZS5uZXQvc2FtbDwvc2FtbDpJc3N1ZXI+PHNhbWxwOk5hbWVJRFBvbGljeSBGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjEuMTpuYW1laWQtZm9ybWF0OmVtYWlsQWRkcmVzcyIgQWxsb3dDcmVhdGU9InRydWUiLz48L3NhbWxwOkF1dGhuUmVxdWVzdD4= | Message type: AuthnRequest; Binding: HTTP-POST (plain Base64 XML); ID: _post9f8e7d; IssueInstant: 2026-03-14T09:26:53Z; Destination: https://idp.example.org/sso/post; AssertionConsumerServiceURL: https://sp.example.com/acs?x=1&y=2; ProtocolBinding: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact; Issuer: https://sp2.example.net/saml; NameIDPolicy: Format=urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress; AllowCreate=true |
FAQ
What exactly does this saml request decoder do?
It takes a SAMLRequest parameter from an HTTP Redirect binding, reverses the URL encoding, base64 decoding and DEFLATE decompression, and then parses the resulting XML to display the AuthnRequest fields.
Can I paste a full URL instead of just the parameter value?
Yes. The tool finds the SAMLRequest query parameter in the URL, percent-decodes it and then decodes the payload. A plain Base64 value from a POST form also works.
Why does my SAMLRequest fail to decompress?
The most common reasons are double URL encoding, truncated payloads due to URL length limits, or the sender incorrectly using zlib compression instead of raw DEFLATE as the SAML specification requires.
Is my SAML data sent to a server?
No. All decoding, including the DEFLATE decompression and XML parsing, happens locally in your browser. Nothing is uploaded anywhere.
What is the difference between SAMLRequest and SAMLResponse?
SAMLRequest is the authentication request sent from the service provider to the identity provider. SAMLResponse is the assertion sent back after authentication. They use different structures and sometimes different encoding methods.
Does this tool validate the SAML request signature?
No. This tool only decodes and displays the request contents. Verifying XML digital signatures requires the signing certificate and is outside the scope of this decoder.