Skip to content

Raise InvalidJwtError in JWTValidator.avalidated_claims() when kid does not match#67909

Open
stephen-bracken wants to merge 1 commit into
apache:mainfrom
stephen-bracken:clear-bad-refresh
Open

Raise InvalidJwtError in JWTValidator.avalidated_claims() when kid does not match#67909
stephen-bracken wants to merge 1 commit into
apache:mainfrom
stephen-bracken:clear-bad-refresh

Conversation

@stephen-bracken
Copy link
Copy Markdown
Contributor

@stephen-bracken stephen-bracken commented Jun 2, 2026

Raise InvalidJwtError in JWTValidator.avalidated_claims() when kid does not match

If the user has a JWT that does not match the validator's JWKS kids, currently they will get a 500 'Internal Server error' response from airflow. Raising jwt.InvalidTokenError from JWTValidator.avalidated_claims() allows those tokens to be cleared and the users can then log in again.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)
  • No

@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Jun 2, 2026
@stephen-bracken stephen-bracken force-pushed the clear-bad-refresh branch 2 times, most recently from 562f229 to c8792b2 Compare June 2, 2026 18:52
@stephen-bracken stephen-bracken marked this pull request as ready for review June 2, 2026 19:18
@stephen-bracken stephen-bracken force-pushed the clear-bad-refresh branch 2 times, most recently from 10861e5 to 123cc9b Compare June 2, 2026 19:27
@stephen-bracken stephen-bracken changed the title Handle invalid JWTs in JWTRefreshMiddleware Raise InvalidJwtError in JWTValidator.avalidated_claims() when kid does not match Jun 2, 2026
@stephen-bracken stephen-bracken force-pushed the clear-bad-refresh branch 2 times, most recently from 0d48a13 to 8a409c4 Compare June 2, 2026 20:00
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants