Skip to content

fix(idp): stamp current signing key's kid on refreshed tokens#171

Open
paulojmdias wants to merge 1 commit into
sigbit:mainfrom
paulojmdias:fix/idp_kid
Open

fix(idp): stamp current signing key's kid on refreshed tokens#171
paulojmdias wants to merge 1 commit into
sigbit:mainfrom
paulojmdias:fix/idp_kid

Conversation

@paulojmdias

Copy link
Copy Markdown

Summary

Fosite restores the persisted session (including JWTHeader.kid) on refresh_token grants. After the proxy's signing key is rotated (e.g., via cert-manager), the emitted JWT was signed with the new key but advertised the old kid, causing downstream JWKS-based verifiers to fail with "no keys found" until the user performed a full re-auth.

Override the kid header with the current key's ID before minting the access response.

Adds TestRefreshTokenUsesCurrentSigningKid which simulates a pod restart with a rotated key and asserts the refreshed token advertises the new kid.

Type of Change

  • fix: A bug fix

Assisted-By: Claude Opus 4.7

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
@paulojmdias paulojmdias requested a review from a team as a code owner May 27, 2026 13:09
@paulojmdias paulojmdias requested review from hrntknr and removed request for a team May 27, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant