Revoke JWT token on provider-level /auth/logout routes - #70593
Open
securylight wants to merge 1 commit into
Open
Revoke JWT token on provider-level /auth/logout routes#70593securylight wants to merge 1 commit into
securylight wants to merge 1 commit into
Conversation
The core /auth/logout route (core_api/routes/public/auth.py) revokes the current JWT before redirecting to the auth manager's logout URL (see apache#67289). FabAuthManager's and KeycloakAuthManager's own provider-level /auth/logout routes redirect straight to the IdP without the same revocation call, so a token is still valid if that route is reached directly instead of through the core route. This adds the same revoke_token() call to both provider routes for consistency, so a JWT is revoked regardless of which /auth/logout path handles the request.
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
vincbeck
requested changes
Jul 28, 2026
vincbeck
left a comment
Contributor
There was a problem hiding this comment.
This is done even if the auth manager has its custom logout route. Why doing it twice? https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/core_api/routes/public/auth.py#L65
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.
Core's
/auth/logout(#67289) revokes the current JWT before redirecting to the auth manager's logout URL. FabAuthManager's and KeycloakAuthManager's own/auth/logoutroutes don't do the same before redirecting to the IdP, so a token stays valid if that route is reached directly. This adds the samerevoke_token()call to both, for consistency.Test plan
test_logout_revokes_token/test_logout_without_token_cookie_does_not_revokefor both providersWas generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Sonnet 5) following the guidelines