mcp-auth-proxy icon indicating copy to clipboard operation
mcp-auth-proxy copied to clipboard

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

Open paulojmdias opened this issue 6 months ago • 0 comments

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

  • [X] fix: A bug fix

Assisted-By: Claude Opus 4.7

paulojmdias avatar May 27 '26 13:05 paulojmdias