IdP-initiated SAML SSO: safely handle unsolicited responses
Learn when to accept unsolicited SAML responses and how to preserve issuer, signature, ACS, audience, time, and replay checks without request correlation.
IdP-initiated SAML SSO starts when a user selects an app in the Identity Provider (IdP) portal and the IdP sends a SAML Response to the Service Provider (SP) without a preceding AuthnRequest. This can simplify app launch, but the SP cannot correlate the response to a request it created. If unsolicited responses are accepted, the SP still needs to validate the trusted issuer, signatures, ACS recipient, audience, time limits, and replay status.
How it differs from SP-initiated SSO
In SP-initiated SSO, the SP creates an AuthnRequest and can match the returned response to its request ID. In the unsolicited IdP-initiated flow, there is no such request. The SAML Web Browser SSO profile permits this flow and says an unsolicited Response must not contain InResponseTo. When metadata is used, the response or artifact should be delivered to the SP's default ACS.
If users do not need IdP-initiated login, leaving that receive path disabled can simplify operations. If it is enabled, design account switching and post-login navigation for a response that may arrive in an unexpected browser context. These are application design recommendations, separate from the profile's normative requirements.
Configure the receive path
Register approved IdPs in advance. Obtain entity IDs, signing keys, trusted metadata, and supported ACS bindings from the approved integration configuration.
Decide whether to accept unsolicited responses. Do not turn every request without a request ID into a generic login; scope acceptance to contracted IdPs and profiles.
Set the default ACS in SP metadata and confirm the IdP delivers unsolicited responses there.
Validate the Response and Assertion: signatures and issuer, audience containing the SP entity ID, bearer `Recipient` matching the actual receiving ACS, confirmation time limits, and assertion Conditions.
Apply correlation rules precisely. Do not expect `InResponseTo` on an unsolicited response. If it is present or conflicts with the agreed profile, investigate rather than silently ignoring it.
Map the account using a stable subject in issuer context, and record used Response/Assertion IDs for the validity period to prevent replay.
Handle RelayState only through an agreed trust path. Do not redirect to arbitrary browser input; allow an approved internal destination or use a safe default.
Issue the SP session only after validation. On failure, return a safe error; partial parsing of an Assertion is not grounds to log in.
Trade-offs
| Consideration | Effect | Response |
|---|---|---|
| App selection in IdP portal | Users can launch an app without finding its login page | Confirm the account and IdP are actually linked to the SP |
| No request correlation | There is no prior AuthnRequest ID to compare | Dedicated unsolicited path, full assertion checks, replay protection |
| Original destination | SP did not save the page before login | Safe fixed default or agreed, allow-listed RelayState |
| Account confusion | Another account may already be active in the browser | Make the account being linked clear and provide account switching |
| Incident investigation | No SP request ID exists before receipt | Audit non-sensitive correlation ID, IdP, ACS, and validation outcome |
Troubleshooting
**Response contains `InResponseTo`:** determine whether the flow was SP-initiated and check that the two flows are not mixed.
**Response reaches the wrong ACS:** compare the IdP's cached metadata with the SP's default endpoint and binding.
**Signature or audience fails:** use the pre-registered IdP trust configuration, SP entity ID, and key-rotation state; do not trust a key supplied inside the response.
**User lands on the wrong page:** restrict RelayState to approved internal destinations and use the default landing page for unsupported values.
**A replay succeeds:** check shared replay storage across SP instances and expiry handling.
Verification plan
Use a test IdP portal and confirm that an unsolicited Response reaches the default ACS. Accept a valid flow with no InResponseTo; reject a different issuer, invalid signature, wrong Audience or Recipient, expired Assertion, duplicate ID, and RelayState pointing to an external domain. Also inspect account selection when another account is already active in the browser. This is a proposed verification plan, not a report of tests performed.
References
[OASIS SAML V2.0 Profiles, §§4.1.3–4.1.5](https://docs.oasis-open.org/security/saml/v2.0/saml-profiles-2.0-os.pdf)
[OASIS SAML V2.0 Metadata](https://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf)