The ID token is rejected, or silent sign-in fails
After the printing site moves to a new configuration file, Tari's sign-in comes back from the photo service and is refused, and a background check floods the network with requests. This lesson finds which ID token check failed, from the 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. and audience to the nonceA random value used for one attempt only. In OpenID Connect, the client sends one in its sign-in request and checks that the same value comes back inside the ID token, showing the token answers this attempt. and expiry, and handles prompt=none errors without a silent retry loop.
Sign-in succeeds, but the app refuses it
The printing company's website lets customers sign in with their photo service account. Last week its team moved the site to a new hosting platform, and as part of the move they replaced a handful of environment variables with a single configuration file. The release went out on Monday morning. By ten o'clock there are two tickets.
The first is from customers. Tari writes: "I click Sign in, the photo service asks for my password and my code as usual, and then the printing site says Sign-in failed." The second is from the site's front-end developers: the background check that keeps a customer signed in across tabs has stopped working, and the browser's network panel is full of requests to the photo service.
Tari's description already places the failure. She reached the photo service, proved who she was and came back, so the provider did its part. The photo service's audit trail agrees: a successful sign-in, a code issued to printer-web and a token request that returned 200. Whatever went wrong happened after the printing site received the tokens, in the step where it checks the ID token, the signed statement from the provider that says who signed in. The site's own log says which check refused it:
10:04:51.210 callback state=match code=present attempt=at-71c2
10:04:51.402 token.response status=200 id_token=present attempt=at-71c2
10:04:51.405 id_token.verify signature=valid kid=photos-2026-09 attempt=at-71c2
10:04:51.405 id_token.reject check=iss expected="https://auth.photos.example/"
actual="https://auth.photos.example" attempt=at-71c2The 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. verified, so the token is genuine and unaltered. It was the comparison after the signature that failed. OpenID ConnectAn identity layer on top of OAuth 2.0 that lets an application sign people in with an account at another service. It adds the ID token, standard claims, and discovery to the OAuth exchange. Core, in its section on ID token validation, lists those comparisons: the issuer, the audience, the expiry time and, when the request sent one, the nonce. A relying partyAn application that accepts and relies on a sign-in from another service, the name used in OpenID Connect and for passkeys. SAML calls the same role a service provider., which is what OpenID Connect calls the application that accepts the ID token, must apply each of them. A valid signature proves who issued the token, not that it was meant for this site or this attempt. Validating an ID token walks through each step. Here you need to read them when one fails.
Compare the issuer exactly
Decode the rejected token on your own machine and put its claims next to the new configuration file:
Header:
{ "alg": "ES256", "kid": "photos-2026-09", "typ": "JWT" }
Claims:
{
"iss": "https://auth.photos.example",
"sub": "user-7310",
"aud": "printer-web",
"iat": 1792404290,
"exp": 1792404590,
"auth_time": 1792404281,
"nonce": "<redacted>"
}
# oidc.yaml, deployed Monday
issuer: https://auth.photos.example/
client_id: printer-web
audience: https://api.photos.example
redirect_uri: https://printer.example/callback
session_check: iframeThe only difference in the issuer is the final slash. To a person, those are the same address. To OpenID Connect they are different issuers. The specification requires the iss claim to exactly match the issuer the relying party expects, character for character, with no normalization. OpenID Connect DiscoveryA JSON document that an OpenID Provider publishes at a well-known address under its issuer, listing its endpoints, where to find its signing keys, and its supported features so clients can configure themselves from one value. adds the other half: the issuer value in a provider's discovery document must be identical to the issuer 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. used to fetch it. The provider publishes one exact string, and every token it issues carries that string.
So the right value is not something you remember or retype. Fetch the discovery document and copy its issuer:
GET /.well-known/openid-configuration HTTP/1.1
Host: auth.photos.example
HTTP/1.1 200 OK
Content-Type: application/json
{
"issuer": "https://auth.photos.example",
"authorization_endpoint": "https://auth.photos.example/authorize",
"token_endpoint": "https://auth.photos.example/token",
"jwks_uri": "https://auth.photos.example/jwks",
...
}The old environment variable had held exactly that. Whoever wrote the new file added a slash out of habit. The same trap catches http versus https, a capital letter in the host name, or an issuer with a path such as /workforce where the provider publishes none. Resist the quick fix of stripping slashes in code or comparing with "starts with". The exact comparison is what stops a token from another issuer, perhaps one at a similar address, from being accepted as this one's.
Audience, azp and nonce
With the issuer corrected, Tari tries again and gets the same error page. The log has moved on to the next check, which is progress:
10:31:07.118 id_token.reject check=aud expected="https://api.photos.example"
actual=["printer-web"] attempt=at-80e4An ID token is addressed to the client that asked for it, so its aud claim must contain that client's ID, here printer-web. The new file also set audience to the photo APIAn application programming interface: a defined way for software to interact with a service. A web API offers endpoints where other programs send HTTP requests.'s address, and the site's OpenID Connect library used that setting for the ID token check. That address is the audience of the access tokens the photo API accepts, and it has no business in an ID token. Removing the override, so the library checks for its own client ID, is the repair.
An ID token can have more than one audience, as an array. When it does, the relying party must find its own client ID in the list, and it must refuse the token if any other audience is one it does not trust. A token addressed to printer-web and to a reporting client the site has never heard of should be refused. Such tokens may also carry azp, the authorized party: the client the token was actually issued to. Earlier editions of the specification asked relying parties to check azp whenever there were several audiences. The current text leaves that check to the extensions that produce multi-audience tokens, and says that validation may include confirming that azp equals your client ID. If azp is present and names a different client, that token was issued to someone else.
A few other rejections in the morning's log have nothing to do with the move:
09:12:44.630 id_token.reject check=nonce result=mismatch state=match attempt=at-6a19
09:47:02.301 id_token.reject check=exp exp=09:51:20Z now=09:53:02Z leeway=60s host=web-3The nonce is a random value the site puts in its authorizationDeciding whether a requested action is permitted, such as whether a signed-in account may delete a particular photo. Authentication says which account is asking; authorization decides what it can do. request and expects to find, unchanged, in the ID token that comes back. It must equal the value that this browser's pending attempt sent. A mismatch means the token belongs to a different attempt, or that someone is replaying a token captured elsewhere. In this log, the customers behind the mismatches had started sign-in in two tabs. The site keeps a separate record for each attempt's state but only one nonce per browser 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., so the second tab overwrote the first tab's value. The check was right to refuse. The fix is to keep the nonce in the same per-attempt record as the state, not to stop checking it.
The expiry line is the time check. exp is when the token stops being acceptable and iat is when it was issued, and a relying party allows a small leeway, usually a minute or two, for clocks that differ slightly. Here one web server, web-3, believed it was six minutes later than it was. The repair for that is time synchronization on web-3. A leeway of an hour would hide it and weaken every token check on every server.
Silent sign-in errors
The second ticket comes from one innocent-looking line in the new file: session_check: iframe. The old setup checked the customer's sign-in once, with a full-page redirect, when the site first loaded. The new setting makes the site check every few minutes in a hidden iframe, using a silent sign-in request: an ordinary authorization request with prompt=none.
GET /authorize?response_type=code&client_id=printer-web
&redirect_uri=https%3A%2F%2Fprinter.example%2Fcallback&scope=openid
&prompt=none&state=<redacted>&nonce=<redacted>
&code_challenge=<redacted>&code_challenge_method=S256 HTTP/1.1
Host: auth.photos.example
Sec-Fetch-Dest: iframe
Sec-Fetch-Site: cross-site
HTTP/1.1 302 Found
Location: https://printer.example/callback?error=login_required
&error_description=End-user%20authentication%20is%20required
&state=<redacted>&iss=https%3A%2F%2Fauth.photos.exampleprompt=none tells the provider that it must not show any page at all. If it can answer from an existing session without asking the user anything, it returns a code as usual. If it cannot, it does not show a sign-in screen. It sends an error back to the redirect URI instead, and the error says what it would have needed:
login_required: the provider has no signed-in session for this browser.consent_required: the user is signed in but has not consented to what the client asked for.interaction_required: some other interaction is needed, such as a step-upAsking someone who is already signed in for stronger evidence before a sensitive action, such as requiring a passkey to export payroll after a password sign-in. check or new terms to accept.account_selection_required: several accounts are signed in and the user must choose one.
Every one of these means the same thing for the relying party: stop being silent. The next sign-in must be an interactive one, a normal top-level redirect without prompt=none, started when the customer chooses to sign in or next needs to. The site's new code did the opposite. On login_required it waited five seconds and tried silently again, which is why the network panel filled up. A provider that sees the same browser asking every few seconds may start rate-limiting it, and the answer was never going to change.
It was never going to change because login_required here did not mean "this customer signed out". The Sec-Fetch-Site: cross-site header shows the iframe is a third-party context: a page from auth.photos.example embedded in printer.example. Modern browsers block or partition third-party cookies, so the provider's session cookieA small value that a website asks the browser to store and send back with later matching requests. Cookies commonly carry a session identifier, so the site can recognize an ongoing sign-in without your password. was never sent with the framed request. The photo service's audit record says so directly:
operation oidc.authorize
outcome rejected
reason login_required (no session cookie presented)
client printer-web
prompt none
request_id 2e9b4a17-60c3-4d8f-b1a5-7c0e93d2f846Tari was signed in at the photo service the whole time. The cookie simply never arrived. Some providers also forbid framing their pages altogether, and then the iframe may never reach the callback at all, so the check just times out. A hidden iframe is no longer a dependable way to ask a provider about its session.
Repair the relying party, not the token
Every fault in this incident was in the printing site's configuration or in how it handled an answer. The provider issued correct tokens and gave correct errors throughout. The repairs follow from that:
- Set
issuerto the exact value from the discovery document. - Remove the
audienceoverride, so the ID token check expectsprinter-web. - Store each attempt's nonce with its state, so a second tab cannot overwrite the first.
- Restore time synchronization on
web-3and keep the leeway at sixty seconds. - Set
session_checkback to a single top-level check on first load, and treat anyprompt=noneerror as "show the signed-out state and offer Sign in", with no automatic retry.
The tempting shortcuts all weaken the site. Turning off the issuer or audience check, accepting any audience in the list, skipping the nonce, or widening the leeway would each make the errors stop by accepting tokens the site should refuse. Editing a token's claims to make it pass is not a repair at all: the signature covers the claims, and a relying party that accepted an altered token would be trusting something the provider never said.
Then verify both directions with a test account. Sign-in succeeds, and a new tab no longer triggers a stream of silent requests. A token that must still be refused still is: an ID token issued to the site's staging client, sent to the production callback in a test, is rejected on aud, and replaying an old callback fails on state or nonce.
Worked example: the validation ledger
The team's write-up records each rejection the site logged, what proved its cause and what changed. It quotes claim names and outcomes, never token values.
| Log line | Evidence | Cause | Repair |
|---|---|---|---|
check=iss | Configured issuer ends in /; discovery issuer does not | Retyped issuer in the new file | Copied issuer from discovery |
check=aud | Expected the API's address; token aud is printer-web | audience override meant for access tokens | Removed the override |
check=nonce | state matched, nonce did not; two tabs open | One nonce per session, overwritten | Nonce stored per attempt |
check=exp | Only on web-3, six minutes ahead | Clock drift on one server | Time sync restored; leeway unchanged |
error=login_required every 5 s | Provider audit: no session cookie presented; Sec-Fetch-Site: cross-site | Hidden iframe cannot send the provider's cookie; silent retry loop | Top-level check on load; interactive sign-in on any prompt=none error |
Not changed: the photo service's configuration, the site's client registration, the signature check and the sixty-second leeway.
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
- Find why the app refuses a good ID token and a silent sign-inA teammate's new verifier settings refuse every sign-in. Validate a real ID token stage by stage, fix the issuer and audience, catch a nonce from another attempt, and read two silent sign-in errors.