Repository navigation
[v3-3-test] Revoke every credential presented to the Core API logout endpoint (#72649) - #72933
Merged
Merged
Conversation
…endpoint (#72649) logout() read only the _token cookie. A client authenticating with an Authorization: Bearer header -- the documented way to call the Core API -- therefore received a normal logout response while its token was never revoked, and that token stayed valid until it expired. The default lifetime is 24 hours. A copy of the token held by anyone else survived the holder's logout, so asking to be logged out did not end the session it was presented for. Logout uses collect_request_tokens() and revokes all of them, not just the precedence-selected one. It walks the same order get_user() authenticates by, so logout does not hard-code its own separate answer to what a request's credentials are. Revoking only the winner would leave any other credential the caller presented valid after they asked to be logged out, and which credential wins is a question about authentication that should not decide what a logout terminates. Revocation still happens before any redirect or cookie deletion, so an external auth-manager logout URL cannot skip it. The bearer tests fail against unpatched sources with 'assert False is True' -- the token is simply not revoked. (cherry picked from commit 3f0a5d6) Co-authored-by: Jarek Potiuk <jarek@potiuk.com> Generated-by: Claude Code (Opus 5) Claude-Session: https://claude.ai/code/session_01XS3bodTDYYGrPmorhtLsjP
1 task done
vatsrahul1001
marked this pull request as ready for review
September 11, 2026 09:34
vatsrahul1001
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun,
rawwar and
shubhamraj-git
as code owners
September 11, 2026 09:34
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.
logout() read only the _token cookie. A client authenticating with an
Authorization: Bearer header -- the documented way to call the Core API --
therefore received a normal logout response while its token was never revoked,
and that token stayed valid until it expired. The default lifetime is 24 hours.
A copy of the token held by anyone else survived the holder's logout, so asking
to be logged out did not end the session it was presented for.
Logout uses collect_request_tokens() and revokes all of them, not just the
precedence-selected one. It walks the same order get_user() authenticates by, so
logout does not hard-code its own separate answer to what a request's credentials
are. Revoking only the winner would leave any other credential the caller
presented valid after they asked to be logged out, and which credential wins is a
question about authentication that should not decide what a logout terminates.
Revocation still happens before any redirect or cookie deletion, so an external
auth-manager logout URL cannot skip it.
The bearer tests fail against unpatched sources with 'assert False is True' --
the token is simply not revoked.
(cherry picked from commit 3f0a5d6)
Co-authored-by: Jarek Potiuk jarek@potiuk.com
Generated-by: Claude Code (Opus 5)
Claude-Session: https://claude.ai/code/session_01XS3bodTDYYGrPmorhtLsjP