fix(caddy): end the Bitborg-id session on Forgejo sign-out #755
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-infra!755
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "fix/forgejo-sso-logout"
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?
Signing out of Forgejo now also ends the Bitborg-id session. Before, the next "Sign in" signed the user straight back in.
Forgejo v16 has no RP-initiated logout, so Caddy on
git.*does it:POST /user/logout: the 200 reply is rewritten to{"redirect":"/user/sso-logout"}and sets a 60-second cookie,bitborg_sso_logout. Forgejo's ownSet-Cookieheaders pass through./user/sso-logout, or to/when its event stream reports the logout first. The first navigation with the cookie deletes it and redirects to Keycloak'sopenid-connect/logoutwithclient_idandpost_logout_redirect_uri.git.*can set the cookie, so a link from another site cannot sign anyone out./user/sso-logoutwithout the cookie redirects to/.id_token_hint.forgejo_oidc_client_idmoves togroup_vars/allso the caddy role can read it.Tested on staging: curl for each path (logout reply and cookies, the
/path, a stale or cross-site/user/sso-logout,/user/loginand?local=1unchanged), and a browser run: sign in, sign out, confirm page, signed out, next sign-in shows the login form.Closes #646
28ba11e6f6973eb3fa0b