Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

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 issuer and audience to the nonce 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-71c2

The signature verified, so the token is genuine and unaltered. It was the comparison after the signature that failed. OpenID Connect 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 party, 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: iframe

The 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 Discovery adds the other half: the issuer value in a provider's discovery document must be identical to the issuer URL 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-80e4

An 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 API'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-3

The nonce is a random value the site puts in its authorization 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 session, 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.example

prompt=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-up 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 cookie 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-7c0e93d2f846

Tari 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.

Monday's two failures. A genuine token refused because the configured issuer has one extra slash, and a silent check answered with login_required because the provider's cookie never arrived.

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 issuer to the exact value from the discovery document.
  • Remove the audience override, so the ID token check expects printer-web.
  • Store each attempt's nonce with its state, so a second tab cannot overwrite the first.
  • Restore time synchronization on web-3 and keep the leeway at sixty seconds.
  • Set session_check back to a single top-level check on first load, and treat any prompt=none error 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.

ID token and silent sign-in failures after the configuration move
Log lineEvidenceCauseRepair
check=issConfigured issuer ends in /; discovery issuer does notRetyped issuer in the new fileCopied issuer from discovery
check=audExpected the API's address; token aud is printer-webaudience override meant for access tokensRemoved the override
check=noncestate matched, nonce did not; two tabs openOne nonce per session, overwrittenNonce stored per attempt
check=expOnly on web-3, six minutes aheadClock drift on one serverTime sync restored; leeway unchanged
error=login_required every 5 sProvider audit: no session cookie presented; Sec-Fetch-Site: cross-siteHidden iframe cannot send the provider's cookie; silent retry loopTop-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.

A relying party logs check=iss expected="https://auth.photos.example/oidc" actual="https://auth.photos.example/oidc/" for a token whose signature verified. What is the right repair? 1 of 3

Choose one answer.

A site checks the session every few minutes from a hidden iframe with prompt=none. The callback receives error=login_required, yet the user is signed in at the provider in another tab. What is the most likely explanation? 2 of 3

Choose one answer.

An ID token arrives with aud set to ["printer-web", "reports-tool"], and the printing site has never heard of reports-tool. What should the site do with it? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity