OIDC Signing Key Rotation: Why Logins Fail After a JWKS Change
Blog post from SSOJet
OIDC login failures can occur when an identity provider rotates its signing keys and an application’s cached JWKS does not contain the new key identified by an ID token’s `kid` header. OpenID Connect specifications direct verifiers to retrieve the JWKS again when encountering an unfamiliar key ID, since providers such as Okta and Microsoft Entra may rotate keys without guaranteed notice, including during emergencies. Tests described in the text found that openid-client 6.8 waits until its cached JWKS is at least 60 seconds old before refetching after an unknown `kid`, potentially causing brief login failures, while coreos/go-oidc 3.21 immediately refreshes and merges concurrent fetches. Recommended implementations refresh keys in the background, isolate caches by issuer or tenant, rate-limit refresh attempts to limit load from invalid tokens, and retry validation once before rejecting an unknown key. The text also notes that SAML integrations face a comparable issue with rotated signing certificates and recommends testing both normal and emergency rotation behavior with tools such as mock-idp.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| Platform Engineering | 18 | 1,145 | 237 | 66 | -43% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.