OIDC callback does not invalidate a cached client id the provider rejects #102

Closed
opened 2026-09-12 19:54:08 -04:00 by jared · 0 comments
Owner

Location: src/app/pages/auth/oidc/OidcCallback.tsx, src/app/pages/auth/oidc/oidcState.ts (isStaleClientError, added in #67)

Problem

generateOidcAuthorizationUrl builds the URL locally and registerOidcClient only runs when no cached id exists, so a stale cached dynamic client id is only ever rejected on the redirect back (?error=invalid_client). That path is handled in OidcCallback.tsx, which never calls invalidateCachedClient, so a genuinely stale id is never auto-evicted and every login attempt fails until the user clears storage. (#67 fixed the opposite problem: over-eager invalidation on transient errors.)

Suggested fix

In the callback's error branch, when isStaleClientError(params) is true, resolve the issuer (from the stored OIDC state in sessionStorage or the login config) and call invalidateCachedClient(issuer) so the next attempt re-registers.


Follow-up from the September 2026 audit fix rounds.

**Location:** `src/app/pages/auth/oidc/OidcCallback.tsx`, `src/app/pages/auth/oidc/oidcState.ts` (`isStaleClientError`, added in #67) ### Problem `generateOidcAuthorizationUrl` builds the URL locally and `registerOidcClient` only runs when no cached id exists, so a stale cached dynamic client id is only ever rejected on the redirect back (`?error=invalid_client`). That path is handled in `OidcCallback.tsx`, which never calls `invalidateCachedClient`, so a genuinely stale id is never auto-evicted and every login attempt fails until the user clears storage. (#67 fixed the opposite problem: over-eager invalidation on transient errors.) ### Suggested fix In the callback's error branch, when `isStaleClientError(params)` is true, resolve the issuer (from the stored OIDC state in sessionStorage or the login config) and call `invalidateCachedClient(issuer)` so the next attempt re-registers. --- _Follow-up from the September 2026 audit fix rounds._
jared added this to the Audit 2026-09 · Medium & Low milestone 2026-09-12 19:54:08 -04:00
jared added the bugpriority: lowarea: auth-session labels 2026-09-12 19:54:08 -04:00
jared self-assigned this 2026-09-12 19:54:08 -04:00
jared closed this issue 2026-09-13 00:56:42 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#102