SAML assertions: understand Subject, Conditions, and statements
Learn what SAML assertion components claim, how profile rules affect their meaning, and what a receiver must not infer from them.
SAML assertions: understand Subject, Conditions, and statements
A SAML assertion is an XML security statement an issuer makes about a subject. Subject identifies who the statements concern, Conditions limit use, and each statement makes a different kind of claim. Core syntax and login requirements are not identical: apply the SAML profile used by the exchange.
Response and Assertion
A Response is a protocol message; an Assertion is a claim it can carry. Receiving a browser SAMLResponse does not prove the assertion is trusted or intended for the current service. Delivery and request correlation belong to the protocol/profile; the elements below describe the assertion.
Outer structure
SAML 2.0 Core includes Issuer, ID, IssueInstant, and Version. Signature, Subject, Conditions, and Advice are optional in Core; zero or more statements may appear. A profile can impose more. Web Browser SSO, for example, requires an assertion in a successful response, at least one authentication statement, and bearer subject confirmation with additional checks.
| Element | Meaning | Do not infer from it alone |
|---|---|---|
Issuer | SAML authority named as issuer | That it is trusted; use configured trust and signature validation. |
ID, IssueInstant, Version | Assertion ID, issue time, and version | That it is fresh or unused; check time and replay per policy. |
Subject | Principal covered by statements, with identifier and confirmation method(s) | That the presenter proved they are that principal; validate SubjectConfirmation. |
Conditions | Use constraints, such as validity time and AudienceRestriction | That the full assertion is trusted; issuer trust and integrity are separate. |
Signature | If present, evidence to validate integrity of the signed scope and possession of the signing key | That any key is trusted or unsigned XML is covered. |
Advice | Additional information that may help interpret the assertion | Authorization unless another contract/profile defines it. |
Three statement types
`AuthnStatement` claims authentication at a time and in a context. `AuthnInstant` is the time; `AuthnContext` is the context. Neither automatically sets the application assurance level or reauthentication policy. Core requires `Subject` here.
`AttributeStatement` associates attributes and values with the subject. Names, formats, and meanings follow the IdP–SP contract. Core also requires `Subject` here.
`AuthzDecisionStatement` says whether an action on a resource is permitted, denied, or undecided. It is different from ordinary role/group attributes or successful login. Use it for authorization only if the application is designed for it.
An assertion may contain multiple statements. Do not collapse “authenticated,” “has an email attribute,” and “may perform an action” into one conclusion. An AuthnStatement does not grant an application role.
Conditions and SubjectConfirmation
NotBefore and NotOnOrAfter limit the time interval in which conditions hold. AudienceRestriction identifies the service the issuer intended. If a condition is unknown or cannot be evaluated, do not assume it passes. Passing time and audience checks still does not establish issuer trust or signature validity.
SubjectConfirmation describes how the presenter is confirmed as the subject. In browser SSO bearer flows, check the profile-defined Recipient, expiry, and request correlation. These are profile requirements, not universal syntax rules.
Apply meaning at the receiver
Process XML with a secure library and the selected profile; confirm the verified signature covers the assertion content actually used.
Match `Issuer` to preconfigured trust. Do not treat an arbitrary certificate embedded in the assertion as a trust anchor.
Evaluate conditions and subject confirmation under the profile. For browser SSO, check current SP audience, ACS destination, time limits, and request correlation.
Use only statement data needed by policy. Limit attribute mapping and retention; handle replay prevention and account linking under separate policy.
Field-name checks alone are insufficient. Signature requirements, confirmation methods, and mandatory conditions depend on the profile and IdP–SP agreement. When processing fails, compare trust metadata, profile, and received assertion structure instead of skipping a missing condition.
References
[OASIS SAML V2.0 Core, §2](https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf)
[OASIS SAML V2.0 Profiles, §4.1](https://docs.oasis-open.org/security/saml/v2.0/saml-profiles-2.0-os.pdf)