Use this when enterprise apps use SAML 2.0 for SSO.
SAML
SAML 2.0 is an XML-based SSO standard where the identity provider sends a signed assertion about the user to the service provider, typically through the browser. It is common in enterprise applications.
1. SAML: XML assertions signed by the IdP, posted to the SP's ACS URL.
2. Validate signature, audience, recipient, time.
3. NameID format must match.
4. Clock skew breaks assertions.
5. Rotate certs before expiry.
SP AuthnRequest → IdP authentication → signed Response/Assertion POSTed to ACS → SP validates issuer, signature, audience, recipient, time, InResponseTo → NameID/attributes mapped → SP session
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Known-good, broken and when it is fixed Verify boundary
Known-good requires a fresh SP login to redirect to the intended IdP, produce a valid signed assertion for the correct audience/recipient, map to the expected local identity and establish the intended application session. An expired/wrong-audience assertion should be rejected. IdP success or a syntactically valid XML assertion does not show SP authorization.
Step 2 Verification path Verify boundary
1. Capture one login with the browser's developer tools (Network, preserve log) or a SAML tracer extension.
2. Find the POST to the ACS URL and decode the SAMLResponse parameter:
# SAMLResponse from the POST body is base64 (URL-decode it first if needed)
echo "$SAMLRESPONSE" | base64 -d | xmllint --format - > response.xml
grep -E 'Issuer|Audience|Recipient|NotOnOrAfter|NotBefore|NameID|InResponseTo|StatusCode' response.xml
3. Check, against the SP configuration: Issuer = IdP entity ID; Audience = SP entity ID; Recipient = ACS URL; times valid; NameID and attributes as expected; StatusCode urn:oasis:names:tc:SAML:2.0:status:Success.
4. Compare the signing certificate in the response's KeyInfo (if present) with the certificate configured at the SP.
5. Read the SP's own log for the validation result — it usually states the exact check that failed.
In Microsoft Entra ID, the enterprise application's sign-in logs show the IdP side, and *Test single sign-on* can decode the request and response.
Step 3 Native failure isolation and next-check logic Narrow the fault
Correlate one login from SP request through IdP authentication to the returned assertion and SP validation result. Check entity IDs, ACS URL, certificate/signature, audience, NotBefore/NotOnOrAfter with clock skew, NameID/claims and group/role mapping. If the SP accepts the assertion but access fails, move to application authorization rather than changing federation metadata.
Step 4 Common mistakes Narrow the fault
- SPs not validating signatures, audience or recipient.
- Letting the IdP signing certificate expire without a rollover plan.
- Using email as NameID when emails can change; prefer a persistent, immutable identifier.
- Allowing IdP-initiated SSO without need.
- Debugging the application before decoding the actual SAML response.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- IdP sends a signed XML assertion via the browser.
- Audience and ACS URL must match.
- Clock skew breaks assertions.
- Browser developer tools / SAML tracer — capture the POST to the ACS URL.
echo "$SAMLRESPONSE" | base64 -d | xmllint --format -— decode the response.- Compare Issuer, Audience, Recipient, NotOnOrAfter, NameID with the SP configuration.
- IdP sign-in logs (e.g. Entra enterprise application) — IdP-side result.
ReferenceWhat it is2 sections · depth on demand
Direct Answer
SAML 2.0 is XML-based SSO: the application (SP) redirects the user to the identity provider (IdP), which POSTs back a signed assertion to the SP's ACS URL. Logins fail when the two sides disagree on entity ID (audience), ACS URL (recipient), signing certificate, clock or NameID/attributes. Decode the SAMLResponse from one login and compare these fields before changing anything.
Scope and canonical references
- Concepts: Single Sign-On, Federation, Identity Provider, Service Provider, Claims.
- Modern alternative: OpenID Connect.
- Products: Microsoft Entra ID, Keycloak.
- Account provisioning for the same apps: SCIM.
- Fault isolation: Federation Troubleshooting.
ReferenceHow it works1 section · depth on demand
How it works
SAML federation moves an authentication assertion from an Identity Provider to a Service Provider through a browser-mediated flow. Trust depends on issuer/entity identity, signing certificate, audience, recipient/ACS, time conditions and subject/attribute mapping. IdP authentication success is upstream evidence only; the SP must independently accept and map the assertion.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
SAML 2.0 (OASIS, 2005) is an XML standard in which an identity provider (IdP) issues a digitally signed assertion about a user, and a service provider (SP) — the application — trusts it to create a session. It remains the most widely supported enterprise SSO protocol for SaaS.
SP-initiated flow (most common)
1. The user opens the application; the SP creates an AuthnRequest and redirects the browser to the IdP (HTTP-Redirect binding).
2. The IdP authenticates the user (password, MFA, existing session).
3. The IdP returns an HTML form that POSTs a Response containing the assertion to the SP's Assertion Consumer Service (ACS) URL (HTTP-POST binding).
4. The SP validates the response and assertion and creates its own session; RelayState returns the user to the page they wanted.
In IdP-initiated SSO the user starts at the IdP portal and there is no AuthnRequest, so the SP cannot check InResponseTo; it is convenient but easier to abuse.
What is inside a response
| Element | Purpose | SP must check |
|---|---|---|
Issuer | Which IdP sent it | Matches the trusted IdP entity ID |
Signature | XML signature over Response and/or Assertion | Valid with the IdP's configured certificate; covers the element actually used |
Subject/NameID | Who the user is (format: email, persistent, transient, unspecified) | Maps to the right local account |
SubjectConfirmationData | Recipient, NotOnOrAfter, InResponseTo | Recipient = ACS URL; not expired; matches the request ID |
Conditions | NotBefore, NotOnOrAfter, AudienceRestriction | Within validity (small clock skew allowed); audience = SP entity ID |
AuthnStatement | When and how the user authenticated | Session lifetime, AuthnContextClassRef if MFA is required |
AttributeStatement | Claims such as email, groups, roles | Expected attribute names and values |
EncryptedAssertion | Optional encryption to the SP's certificate | SP holds the decryption key |
Metadata and trust
IdP and SP exchange metadata XML (EntityDescriptor) containing entity IDs, endpoints (SSO, ACS, SLO) and signing/encryption certificates. Trust is literally the certificate: when the IdP's signing certificate is renewed, every SP must get the new one before the switch, or all logins fail. Publish metadata URLs and add the next certificate in advance where both sides support it.
Single logout (SLO) exists but is unreliable across many SPs; most deployments rely on short session lifetimes instead.
Security
SPs must validate signatures with a strict XML security library and use only the signed elements (XML signature wrapping attacks place an unsigned assertion next to a signed one). Reject unsigned assertions, check audience and recipient, enforce validity windows and replay protection (InResponseTo, one-time assertion IDs).
ReferenceConfiguration & state1 section · depth on demand
Lifecycle and ownership
- Onboarding an application: exchange metadata (or entity ID, ACS URL, certificate), agree on NameID format and attributes, assign users/groups at the IdP, test with a pilot group.
- Certificate rollover: IdP signing certificates expire (often after 1–3 years). Track expiry, add the new certificate to SPs before activation, then switch — or use metadata URLs the SPs refresh automatically.
- Attribute changes: coordinate with the application owner; renaming a claim breaks role mapping.
- Offboarding: remove the SP configuration at the IdP and the trust at the SP; deprovision accounts with SCIM where supported.
- Ownership: the IdP team owns signing keys and policies; the application owner owns ACS/entity ID settings and mapping.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Single Sign-On & Federation → SAML. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc7522 · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Deep reference
Healthy vs suspicious evidence
Output interpretation
| Observation | Meaning |
|---|---|
StatusCode Responder / AuthnFailed | The IdP refused — user not assigned, MFA or policy failure; see IdP logs |
| Audience differs from SP entity ID | Wrong entity ID configured on one side |
| Recipient/Destination differs from the URL the SP listens on | ACS URL mismatch (http vs https, host, path, trailing slash) |
NotOnOrAfter already in the past when received | Clock skew between IdP and SP, or a replayed/old response |
| Signature valid but SP says invalid | SP has the old IdP certificate, or expects the assertion (not only the response) to be signed |
| Login succeeds but wrong user/role in the app | NameID format or attribute mapping mismatch |
InResponseTo mismatch | Response belongs to another request, or the SP lost its request state (cookies, load balancer without session affinity) |