mcp-auth-proxy
mcp-auth-proxy copied to clipboard
fix(idp): stamp current signing key's kid on refreshed tokens
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