The identity provider refuses a SAML request
A SAMLThe Security Assertion Markup Language, a federation standard widely used for workplace single sign-on, in which the identity provider sends the application a signed assertion about the user. sign-in that stops on the identity provider's own page failed before any assertion or signatureA value made with a private key that lets anyone holding the matching public key check that a message came from the key's holder and has not been changed. It proves origin and integrity; it does not hide the message. existed. This lesson follows a studio's sign-in to the printing company's business portal after a library migration, reads the request the portal sent, finds the entity ID the identity provider no longer recognizes, and repairs it without touching a certificate.
Sign-in stops after a weekend migration
All names, domains and identifiers in these examples are fictional. On Monday morning a message arrives from Esme, who runs a small photo studio and orders prints through the printing company's business portal: "I clicked Sign in with Photos and ended up on a page at auth.photos.example that says We can't sign you in to this application. Reference 7c2e41d0. It worked on Friday." Two more studios report the same page within the hour.
The portal at portal.printer.example does not keep its own passwords. It signs studio staff in with SAML, using the photo service's identity provider at auth.photos.example. In SAML terms the portal is the service provider: it asks for a sign-in. The photo service is the identity provider: it authenticates the person and sends back a signed statement about them, called an assertion. These are the two parties How SAML sign-in works introduced.
Your teammate Jonas spent the weekend moving the portal onto a new SAML library. His change note lists the library upgrade, a tidy-up of the portal's configuration file, and a reminder that the identity provider's signing certificate expires on 7 November. Someone in the team chat seizes on that reminder: "Probably the certificate. Can we just swap it now?" A certificate change is a slow, coordinated job, and if it is the wrong fault it adds a second outage to the first. Before anyone touches a key, find out how far Esme's sign-in got.
The error page already says a lot. Esme never came back to the portal, so the attempt failed at the identity provider, before anything was sent back. The reference on the page is the identity provider's request ID, the same kind of thread you pulled with the method from Finding the failing stage, and it is safe to copy into a ticket.
Names, destinations and keys do different jobs
Three pieces of configuration hold a SAML connection together: one says who is asking, one says where an answer may go, and one says whose signature to believe. They are easy to blur because two of them look like web addresses.
The entity ID is the service provider's name. It is a URI, often an https address, but nothing ever fetches it. The identity provider uses it to look up which application is asking, and later writes it into the assertion as the intended audience. The portal's entity ID has been https://portal.printer.example/sp since the connection was set up.
The assertion consumer service, or ACS, is a real endpoint: the address where the identity provider sends its response. For the portal that is https://portal.printer.example/saml/acs. An identity provider sends responses only to an ACS registered for the application, because a response contains a signed statement that someone has just signed in, and it must not go wherever a request asks.
The certificates carry keys. The identity provider signs its responses with its private keyThe half of a key pair that its owner keeps to themselves and uses to create signatures or decrypt data. Anyone who obtains it can act as its owner., and the portal verifies them with the identity provider's certificate, which it loaded from the identity provider's metadata when the connection was configured, as Metadata, certificates, and key rollover described. The portal may also sign its requests, and the identity provider verifies those with the certificate it registered for the portal.
The registration at the identity provider records all three for the portal, along with the name identifierThe value in a SAML assertion's subject that identifies the user to the service provider, in a declared format such as a persistent opaque identifier or an email address. format it releases, which NameID and attributes explained:
Application: Printer business portal
Entity ID: https://portal.printer.example/sp
ACS (HTTP-POST): https://portal.printer.example/saml/acs
Signed requests: required (portal certificate, CN=portal.printer.example, expires 2027-03-02)
NameID format: urn:oasis:names:tc:SAML:2.0:nameid-format:persistentRead the request the portal sent
In a sign-in started at the service provider, the first message is an authenticationChecking evidence that someone, or some application, controls an account, such as a password or a passkey. It establishes which account is being used, not what that account may do. request. The portal builds a samlp:AuthnRequest, and with the HTTP-Redirect binding it sends Esme's browser to the identity provider with the request in a SAMLRequest query parameter, compressed with DEFLATE and then base64-encoded, as SAML bindings showed. The new library writes each outgoing request to its debug log. If you only have the URLA web address, such as https://photos.example/api/albums/42?limit=10. It names how to connect (https), the domain, the path to a particular page or resource, and any extra parameters after the question mark., decode it on your own machine, not in an online decoder. Here is the request from Esme's attempt:
<samlp:AuthnRequest
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="_4f1d8a7c2b9e46d3a0e5"
Version="2.0"
IssueInstant="2026-10-19T08:14:51Z"
Destination="https://auth.photos.example/saml/sso"
AssertionConsumerServiceURL="https://portal.printer.example/saml/acs"
ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST">
<saml:Issuer>https://portal.printer.example/saml/metadata</saml:Issuer>
<samlp:NameIDPolicy
Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
AllowCreate="true"/>
</samlp:AuthnRequest>Read it attribute by attribute. ID is a fresh identifier for this request. The portal stores it, and a genuine response will quote it back. Version is 2.0 and IssueInstant is when the request was made. Destination is the identity provider's single sign-onSigning in once and then using several applications without entering credentials again, usually because they all rely on the same identity provider. endpoint. AssertionConsumerServiceURL asks for the response to go to the portal's ACS, and it matches the registration. NameIDPolicy asks for the persistent identifier format the registration releases.
Then the <saml:Issuer>. It should be the portal's entity ID, https://portal.printer.example/sp. It says https://portal.printer.example/saml/metadata, which is the new library's default: it builds an entity ID from the address where it publishes the portal's metadata. Jonas's configuration tidy-up removed the line that used to override it.
The identity provider's request log, found by the reference on Esme's error page, confirms where the attempt stopped:
2026-10-19T08:14:52.611Z GET /saml/sso 400 stage=application_lookup duration_ms=4
binding=HTTP-Redirect sp_entity_id=https://portal.printer.example/saml/metadata
reason=unknown_service_provider request_id=7c2e41d0-93ab-4f6e-b8d2-55a0c1e9f317The first thing an identity provider does with a request is find the application by its IssuerThe party that creates and signs a token, assertion, or certificate, named in a token's iss claim. A recipient must check that the issuer is exactly the one it expected and trusts.. Only a registered application has an ACS the identity provider trusts, a certificate for checking signed requests, and rules for which attributes to release. With no match, the identity provider has nothing to check the requested ACS against and nowhere it trusts to send a response, so it does not authenticate Esme and does not build an assertion. It shows its own error page, which is exactly what she saw.
That settles the certificate question. The identity provider's signing key signs responses, and no response was ever produced. The portal's request signature would be checked with the certificate registered for the portal, which the identity provider can only find after the lookup succeeds. Neither key was reached. The portal's own log agrees from the other side:
08:14:51.982 saml.authn_request.sent id=_4f1d8a7c2b9e46d3a0e5 destination=https://auth.photos.example/saml/sso
08:19:51.982 saml.pending_request.expired id=_4f1d8a7c2b9e46d3a0e5 response=noneThe request went out, nothing ever reached the ACS, and five minutes later the portal gave up waiting.
When the identity provider answers with an error
Not every refusal ends on the identity provider's page. Once the identity provider has recognized the application and confirmed its ACS, it can report a problem back to the service provider in a samlp:Response that carries a status and no assertion. Suppose the new library had asked for an email address as the name identifier, a format the registration does not release. The portal would receive something like this at its ACS:
<samlp:Response
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="_9b3e07c5a1d24f6e8c4b"
InResponseTo="_4f1d8a7c2b9e46d3a0e5"
Version="2.0"
IssueInstant="2026-10-19T08:14:52Z"
Destination="https://portal.printer.example/saml/acs">
<saml:Issuer>https://auth.photos.example/saml</saml:Issuer>
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Requester">
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy"/>
</samlp:StatusCode>
<samlp:StatusMessage>The requested name identifier format is not available.</samlp:StatusMessage>
</samlp:Status>
</samlp:Response>The outer element holds the top-level status codeThe three-digit number at the start of an HTTP response that says how the request went, such as 200 for success, 302 for a redirect, or 401 when authentication is needed., which says broadly where the problem lies: urn:oasis:names:tc:SAML:2.0:status:Requester points at the request, urn:oasis:names:tc:SAML:2.0:status:Responder at the identity provider itself, and a successful response carries urn:oasis:names:tc:SAML:2.0:status:Success. The nested element holds a second-level code that narrows it down. InvalidNameIDPolicy means the identity provider cannot or will not supply the requested identifier format. NoPassive means the request asked for a sign-in without any user interaction and the identity provider could not manage that. RequestDenied means the identity provider could process the request but chose not to answer it. Any error response like this proves that the application lookup succeeded, so it points somewhere quite different from Esme's error page.
What the service provider checks once a response arrives
When the request stage succeeds, the identity provider authenticates the person and posts a signed response to the ACS. Only now does the service provider's half of the work begin, and only now do certificates matter. The portal checks:
- the Issuer is the identity provider it is configured to trust,
https://auth.photos.example/saml; - the signature on the response or assertion verifies with the certificate from that identity provider's metadata, never with a certificate the message carries about itself;
- the response's
Destinationand theRecipientin the subject confirmation are the portal's own ACS; - the
Audiencein the assertion's audience restriction is the portal's entity ID; - the current time falls inside the
NotBeforeandNotOnOrAfterlimits, allowing only a small clock difference; InResponseTomatches a request the portal sent and is still waiting for;- the assertion's ID has not been accepted before, so a captured response cannot be used twice.
The entity ID appears in two of these stages. It is the Issuer the identity provider looks up, and it comes back as the Audience the portal checks. When a mismatch slips past the lookup, it surfaces at the audience check instead. That happens with a sign-in started at the identity provider, which sends no request to look up, or with a registration that addresses assertions to an audience value the portal no longer expects. Both sides have to agree on one value. Validating a response covers each of these checks in detail.
Put the agreement back
The repair is to make the portal's entity ID and the identity provider's registration agree again. Decide first which value is correct. An entity ID is a long-lived name: the identity provider has it registered, every assertion is addressed to it, and other parties may have recorded it too. Nothing in the migration called for a new name, so the narrow repair is on the portal's side: set the library's entity ID back to https://portal.printer.example/sp. Check the metadata the library now publishes at /saml/metadata as well. Its entityID attribute should show the same value, or anyone who imports the portal's metadata later will pick up the wrong one.
A deliberate rename would be a coordinated change: register the new name at the identity provider and switch the portal at the same moment, keeping the reviewed ACS and certificate. What you must not do is loosen the identity provider. Accepting unregistered entity IDs, or adding the stray default as an extra name without review, would let any request that claims to be the portal decide where a signed assertion goes.
The certificate stays as it is. Its expiry next month is real and deserves its own planned rollover with an overlap period, but it played no part in this outage.
Verify the right account and the remaining boundary
Start a fresh sign-in from the portal's own Sign in button, not from an old response or a bookmarked identity provider address, so that the test sends a new request with the corrected Issuer. The library's log should show <saml:Issuer>https://portal.printer.example/sp</saml:Issuer>, the identity provider's request log should show the lookup passing and a response being issued, and the portal should accept that response through every check in the list above.
Then confirm that the right person reached the right account. Esme should land in her own studio account, found by the identity provider's issuer together with the same persistent name identifier as before the migration. Make sure the new library has not started matching accounts by an email attribute, which is not a safe way to choose an existing account.
Finally, confirm that the boundary still holds. Send a request whose Issuer is an entity ID the identity provider never registered, such as the library's default https://portal.printer.example/saml/metadata from a test instance of the portal. It must still end on the identity provider's error page with unknown_service_provider. If it now succeeds, the connection was "repaired" by weakening the identity provider, and the work is not finished.
Worked example: the handoff note
The note records the failed stage, the one value that was wrong and the evidence that cleared the certificate. It quotes no assertion, attribute values or sessionThe ongoing connection between later requests and an earlier sign-in, so you are not asked for your password on every click. It is often tracked with a cookie holding an unpredictable session identifier. data:
Symptom: Studio staff saw the identity provider's "We can't sign you in to this
application" page from 08:10 UTC (production portal). Last success: Friday.
Last good stage: Portal built and sent the AuthnRequest (ID _4f1d8a7c2b9e46d3a0e5).
First failure: Identity provider application lookup, reason unknown_service_provider
(request 7c2e41d0-93ab-4f6e-b8d2-55a0c1e9f317). No response or assertion issued.
Cause: Library migration dropped the entity ID override. Requests carried Issuer
https://portal.printer.example/saml/metadata; the registered entity ID is
https://portal.printer.example/sp. ACS unchanged.
Repair: Restored the portal's entity ID to https://portal.printer.example/sp
(config 2026.10.19-1). Published metadata shows the same value.
Verification: Fresh sign-in passes the lookup and every portal response check; studio account
reached through the same issuer and persistent NameID. A request with the
unregistered Issuer is still refused at the identity provider.
Not changed: Identity provider registration, both certificates, account links.
Follow-up: Identity provider signing certificate expires 2026-11-07; schedule its rollover.Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Restore the application after its change windowFollow a real SAML sign-in between your two lab tenants, compare names, destinations and keys to find the changed entity ID, restore the agreement and keep an unknown application refused.