[v3-1-test] fix: always include kid in JWT header for symmetric key tokens (#62883)#62943
Merged
[v3-1-test] fix: always include kid in JWT header for symmetric key tokens (#62883)#62943
Conversation
…okens (#62883) When using symmetric (secret_key) signing, the JWTGenerator did not include the 'kid' field in the JWT header. However, JWTValidator always requires 'kid' in the token header, causing all symmetric-key tokens to be rejected with 'Missing kid in token header'. This affected the KeycloakAuthManager (and any auth manager using symmetric JWT signing), creating an infinite redirect loop after successful login. Two changes: 1. Always add 'kid' to the JWT header regardless of key type 2. Check configured jwt_kid before falling back to 'not-used' for symmetric keys, so operators can set a meaningful kid (cherry picked from commit 6b21ec0) Co-authored-by: Yoann <60654707+YoannAbriel@users.noreply.github.com> Closes: #62876
1 task
vincbeck
approved these changes
Mar 5, 2026
eladkal
approved these changes
Mar 5, 2026
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.
When using symmetric (secret_key) signing, the JWTGenerator did not
include the 'kid' field in the JWT header. However, JWTValidator always
requires 'kid' in the token header, causing all symmetric-key tokens
to be rejected with 'Missing kid in token header'.
This affected the KeycloakAuthManager (and any auth manager using
symmetric JWT signing), creating an infinite redirect loop after
successful login.
Two changes:
symmetric keys, so operators can set a meaningful kid
(cherry picked from commit 6b21ec0)
Co-authored-by: Yoann 60654707+YoannAbriel@users.noreply.github.com
Closes: #62876