fix(auth): sign out locally when the stored id token is from another issuer #362
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-web!362
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "fix/signout-stale-session"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Closes #352
A session from before the identity provider change holds an id token from the old issuer. Sign-out sent it as
id_token_hint, and Keycloak rejected the foreign hint with an error page.Sign-out now reads the stored token's
iss. When it differs from the current issuer, the route clears the session cookies and redirects to the portal home without calling the end-session endpoint. A current Keycloak token still goes to the end-session endpoint with the hint, as before.idTokenIssuerreadsisswithout verification. It only decides whether to send the hint, so a forged cookie can at most turn sign-out into a local sign-out.Tests:
src/test/logout.test.tscovers a current-issuer token (end-session with hint) and a foreign-issuer token (local sign-out to/, both cookies cleared). The foreign-issuer test fails without the fix. Pre-push ran lint, type-check, vitest, build and e2e.