Repository navigation
Conversation
…e Authorization header POST /ui/auth/token signed the token with generate_jwt, the method for the browser session cookie. An auth manager that keeps part of its state in cookies leaves that state out of such a token: with the Keycloak auth manager on Airflow 3.3+ the generated token carries no Keycloak tokens, resolves to no user when sent with the Authorization header, and every request answers 500 in the authorization checks. The route now calls generate_api_jwt, which exists for a client that authenticates with the header and sends no cookies. Auth managers whose tokens are self-contained do not override it and are unaffected. The new test asserts the route returns the auth manager's API token for both token types, with their expiration times.
dabla
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun and
shubhamraj-git
as code owners
November 16, 2026 22:35
dabla
requested review from
vincbeck
and removed request for
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun and
shubhamraj-git
November 16, 2026 22:35
This branch has not been deployed
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.
POST /ui/auth/token, the route behind "Generate token" in the UI, signs the token withgenerate_jwt, the method for the browser session cookie. An auth manager that keeps part of its state in cookies leaves that state out of this token. The Keycloak auth manager does so since Airflow 3.3: the Keycloak tokens travel in their own cookies, so the generated token carries none. Sent with theAuthorizationheader it resolves to no user, and every request answers 500 in the authorization checks ('NoneType' object has no attribute 'access_token').The route now calls
generate_api_jwt, which exists for exactly this client: one that authenticates with the header and sends no cookies. Auth managers whose tokens are self-contained do not override it, so nothing changes for them.This is another path to the 500 described in #76352. #76353 fixes the browser session whose Keycloak tokens are gone; this one was found in its review (#76353 (comment)) and is separate because it is a core change, while #76353 only touches the Keycloak provider.
Test: the route returns what
generate_api_jwtreturns, for both token types and with their expiration times. It fails onmain, wheregenerate_jwtis called.related: #76352, #76353, #72381
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5.2) following the guidelines
🤖 Generated with Claude Code