fix(auth): portal sign-out shows the keycloak confirm page despite id_token_hint #398

Stängd
öppnade 2026-10-17 10:30:41 +00:00 av supernaut · 0 kommentarer
Ägare

Portal sign-out shows Keycloak's "Do you want to log out?" confirm page, although the request carries id_token_hint.

Repro

Staging, 2026-10-17, signed in on www.stg.bitborg.se. "Logga ut" posts /auth/logout (302) to id.stg.bitborg.se/realms/bitborg/protocol/openid-connect/logout?client_id=bitborg-web&id_token_hint=…&post_logout_redirect_uri=https://www.stg.bitborg.se/. Keycloak answers 200 with the confirm page instead of logging out and redirecting.

Likely cause

Keycloak's LogoutEndpoint forces the confirm page when the id_token_hint session (sid) does not match the browser's current Keycloak session. The portal may keep an id_token from an earlier session, for example after the Keycloak session was ended elsewhere and a new one started.

To confirm

Decode the sid claim of the id_token the portal sends and compare it with the session in the KEYCLOAK_SESSION cookie on id.stg.bitborg.se.

Done when

  • Portal sign-out with a current session logs out without the confirm page.
Portal sign-out shows Keycloak's "Do you want to log out?" confirm page, although the request carries `id_token_hint`. ## Repro Staging, 2026-10-17, signed in on `www.stg.bitborg.se`. "Logga ut" posts `/auth/logout` (`302`) to `id.stg.bitborg.se/realms/bitborg/protocol/openid-connect/logout?client_id=bitborg-web&id_token_hint=…&post_logout_redirect_uri=https://www.stg.bitborg.se/`. Keycloak answers `200` with the confirm page instead of logging out and redirecting. ## Likely cause Keycloak's `LogoutEndpoint` forces the confirm page when the `id_token_hint` session (`sid`) does not match the browser's current Keycloak session. The portal may keep an id_token from an earlier session, for example after the Keycloak session was ended elsewhere and a new one started. ## To confirm Decode the `sid` claim of the id_token the portal sends and compare it with the session in the `KEYCLOAK_SESSION` cookie on `id.stg.bitborg.se`. ## Done when - [ ] Portal sign-out with a current session logs out without the confirm page.
supernaut lade till detta till projektet Bitborg Web 2026-10-17 10:35:37 +00:00
Logga in för att delta i denna konversation.
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-web#398
Ingen beskrivning angiven.