fix(auth): signing out of Explorer signs out of every Elcano app - #24
Merged
Merged
Conversation
TLDR Explorer's logout used to end only the Explorer session and show its own signed-out page; the central Auth session stayed alive, so the next click on any app signed the user straight back in. Logout now hands the browser to Auth's sign-out endpoint, which ends the central session, tells every registered application to drop its sessions, and lands on Auth's login page. Problem POST /logout revoked the local session and redirected to /signed-out. With Fleet's silent SSO start (FLEET_OIDC_AUTO_START) a user who logged out of Explorer and opened Fleet was signed in again without a prompt, and Explorer itself re-signed them in on the next visit. "Log out" therefore appeared to do nothing, which is the owner's report. Fix - After revoking the local session and clearing the cookie, redirect to `<AUTH_ISSUER_URL>/logout?client_id=<AUTH_CLIENT_ID>` (Auth's RP-initiated logout, ElcanoTek/auth#36). Auth revokes every central session of the account, fans a signed back-channel logout out to every application (Explorer included; idempotent), and shows its login page with a notice. - /signed-out stays as a plain page for direct visits. - Requires Auth main 9f36ed8+ with #36; against an older Auth the GET is a 405, so deploy Auth first. Tests - test_logout_requires_csrf_and_revokes_only_explorer_session now asserts the 303 targets https://auth.example.com/logout?client_id=explorer. - ruff check, ruff format --check, full suite 113 passed.
…kie deletion DEPLOYMENT.md said normal logout stayed scoped to the Explorer session; the test was named for the old contract. Both now match the redirect to Auth's RP-initiated logout, and the test asserts the app cookie is deleted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Explorer's logout used to end only the Explorer session and show its own signed-out page; the central Auth session stayed alive, so the next click on any app signed the user straight back in. Logout now hands the browser to Auth's sign-out endpoint, which ends the central session, tells every registered application to drop its sessions, and lands on Auth's login page.
Problem
POST /logoutrevoked the local session and redirected to/signed-out. With Fleet's silent SSO start (FLEET_OIDC_AUTO_START) a user who logged out of Explorer and opened Fleet was signed in again without a prompt, and Explorer itself re-signed them in on the next visit. "Log out" therefore appeared to do nothing.Fix
<AUTH_ISSUER_URL>/logout?client_id=<AUTH_CLIENT_ID>(Auth's RP-initiated logout, ElcanoTek/auth#36). Auth revokes every central session of the account, fans a signed back-channel logout out to every application (Explorer included; idempotent), and shows its login page with a notice./signed-outstays as a plain page for direct visits.Tests
test_logout_requires_csrf_and_revokes_only_explorer_sessionnow asserts the 303 targetshttps://auth.example.com/logout?client_id=explorer.ruff check,ruff format --check, full suite 113 passed.