fix(auth): signing out of Lens signs out of every Elcano app - #29
Merged
Merged
Conversation
TLDR Lens's logout used to end only the Lens session; the central Auth session stayed alive, so 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 while the Auth session lived on. With Fleet's silent SSO start and Explorer's automatic handoff, "log out" appeared to do nothing. 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), which revokes every central session, fans the back-channel logout out to every application (Lens included; idempotent), and shows Auth's login page with a notice. - /signed-out stays for direct visits. Deploy Auth first (older Auth answers 405 to the GET). Tests - test_central_logout_stays_signed_out_until_the_user_chooses_to_sign_in asserts the redirect targets http://auth.example.com/logout?client_id=lens and still exercises /signed-out directly. - ruff check, ruff format --check, full suite 335 passed.
README and DEPLOYMENT still said central logout ended only the Lens session and landed on /signed-out; the test was named for that. Both now match the redirect to Auth's RP-initiated logout; /signed-out stays a direct-visit page.
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
Lens's logout used to end only the Lens session; the central Auth session stayed alive, so 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-outwhile the Auth session lived on. With Fleet's silent SSO start and Explorer's automatic handoff, "log out" appeared to do nothing.Fix
<AUTH_ISSUER_URL>/logout?client_id=<AUTH_CLIENT_ID>(Auth's RP-initiated logout, ElcanoTek/auth#36), which revokes every central session, fans the back-channel logout out to every application (Lens included; idempotent), and shows Auth's login page with a notice./signed-outstays for direct visits. Deploy Auth first (older Auth answers 405 to the GET).Tests
test_central_logout_stays_signed_out_until_the_user_chooses_to_sign_inasserts the redirect targetshttp://auth.example.com/logout?client_id=lensand still exercises/signed-outdirectly.ruff check,ruff format --check, full suite 335 passed.