Skip to content

Revoke JWT on /auth/logout regardless of auth manager logout URL#67289

Merged
pierrejeambrun merged 1 commit into
apache:mainfrom
astronomer:fix-logout-revoke-token
May 22, 2026
Merged

Revoke JWT on /auth/logout regardless of auth manager logout URL#67289
pierrejeambrun merged 1 commit into
apache:mainfrom
astronomer:fix-logout-revoke-token

Conversation

@pierrejeambrun
Copy link
Copy Markdown
Member

@pierrejeambrun pierrejeambrun commented May 21, 2026

The /auth/logout endpoint previously short-circuited via early return when an auth manager's get_url_logout() returned a URL, and auth_manager.revoke_token(token_str) was never called.

Move the revoke_token call before the early return so logout reliably invalidates the JWT token regardless of which auth manager is configured. Both branches are covered by tests:

  • test_logout_revokes_tokenget_url_logout() returns None (existing test).
  • test_logout_revokes_token_when_logout_url_redirectsget_url_logout() returns a URL (new test).

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7)

Generated-by: Claude Code (Opus 4.7) following the guidelines

@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label May 21, 2026
@pierrejeambrun pierrejeambrun self-assigned this May 21, 2026
@pierrejeambrun pierrejeambrun added the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label May 21, 2026
@pierrejeambrun pierrejeambrun marked this pull request as ready for review May 21, 2026 16:22
Previously, when an auth manager's get_url_logout() returned a URL, the
/auth/logout endpoint short-circuited via early return and never invoked
auth_manager.revoke_token(token_str). The JWT therefore remained valid
after logout for auth managers like FabAuthManager and KeycloakAuthManager
that redirect to an external logout URL.

Move the revoke_token call before the early return so logout reliably
invalidates the JWT token regardless of which auth manager is configured.
@pierrejeambrun pierrejeambrun force-pushed the fix-logout-revoke-token branch from 38daa2f to 4fecf73 Compare May 22, 2026 09:13
@pierrejeambrun pierrejeambrun merged commit b1aec75 into apache:main May 22, 2026
143 checks passed
@pierrejeambrun pierrejeambrun deleted the fix-logout-revoke-token branch May 22, 2026 22:45
@github-actions
Copy link
Copy Markdown
Contributor

Backport successfully created: v3-2-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test PR Link

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request May 22, 2026
…out URL (apache#67289)

Previously, when an auth manager's get_url_logout() returned a URL, the
/auth/logout endpoint short-circuited via early return and never invoked
auth_manager.revoke_token(token_str). The JWT therefore remained valid
after logout for auth managers like FabAuthManager and KeycloakAuthManager
that redirect to an external logout URL.

Move the revoke_token call before the early return so logout reliably
invalidates the JWT token regardless of which auth manager is configured.
(cherry picked from commit b1aec75)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request May 22, 2026
…out URL (apache#67289)

Previously, when an auth manager's get_url_logout() returned a URL, the
/auth/logout endpoint short-circuited via early return and never invoked
auth_manager.revoke_token(token_str). The JWT therefore remained valid
after logout for auth managers like FabAuthManager and KeycloakAuthManager
that redirect to an external logout URL.

Move the revoke_token call before the early return so logout reliably
invalidates the JWT token regardless of which auth manager is configured.
(cherry picked from commit b1aec75)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
jason810496 pushed a commit that referenced this pull request May 23, 2026
…out URL (#67289) (#67362)

Previously, when an auth manager's get_url_logout() returned a URL, the
/auth/logout endpoint short-circuited via early return and never invoked
auth_manager.revoke_token(token_str). The JWT therefore remained valid
after logout for auth managers like FabAuthManager and KeycloakAuthManager
that redirect to an external logout URL.

Move the revoke_token call before the early return so logout reliably
invalidates the JWT token regardless of which auth manager is configured.
(cherry picked from commit b1aec75)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants