Skip to content

Always clear the session cookie on logout - #73788

Merged
shahar1 merged 1 commit into
apache:mainfrom
potiuk:logout-token-revocation
Oct 3, 2026
Merged

shahar1 merged 1 commit into
apache:mainfrom
potiuk:logout-token-revocation

Conversation

@potiuk

@potiuk potiuk commented Sep 27, 2026

Copy link
Copy Markdown
Member

When the auth manager supplies an external logout URL (FAB, Keycloak), /auth/logout revoked the token and redirected without deleting the _token cookie, so the revocation was the only thing ending the local session. revoke_token also caught every failure — including a failure to record the revocation — and logged it as a warning, so a revocation that did not happen looked the same as one that did.

  • The _token cookie is now deleted on every logout path, including the redirect to an external logout URL. Neither the FAB nor the Keycloak logout route reads it (Keycloak uses the separate ID-token cookie).
  • revoke_token separates a token that does not validate (already unusable, logged as a warning, as before) from a valid token whose revocation cannot be recorded, which stays usable until it expires and is now logged as an error.

The new route tests stub the refresh middleware so that only the logout route can clear the cookie.

🤖 Generated with Claude Code

When the auth manager supplies an external logout URL (FAB, Keycloak),
``/auth/logout`` revoked the token and redirected without deleting the
``_token`` cookie, so the revocation was the only thing ending the local
session. ``revoke_token`` also caught every failure -- including a
failure to record the revocation -- and logged it as a warning, so a
revocation that did not happen looked the same as one that did.

Delete the cookie on every logout path, and log a failure to record the
revocation of a valid token as an error, separately from a token that
does not validate and needs no revocation.

Generated-by: Claude Opus 5
@eladkal eladkal added this to the Airflow 3.4.0 milestone Sep 29, 2026
@eladkal eladkal added the type:bug-fix Changelog: Bug Fixes label Sep 29, 2026
@shahar1
shahar1 merged commit 79bc643 into apache:main Oct 3, 2026
79 checks passed
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 type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants