JWKS tokens verification
JWKS tokens verification allows you to validate JWTs using JWKS keys and supports seamless migration from secret/public key verification without logging users out.
Zephr verifies JWKS tokens as below:
-
Key ID (kid) Lookup: Each JWT header must contain a kid parameter matching a key published at your JWKS endpoint. Zephr retrieves the JWKS and verifies the token signature using the matching key.
-
Supported Algorithms: Supports RSAs and Elliptic Curve (EC) keys: RS256, RS512, ES256, ES384, and ES512.
-
Tamper Detection: If a token signature has been altered or fails validation, authentication is rejected.
To avoid logging users out during a migration:
-
If an incoming JWT has no kid, or its kid is missing from the JWKS response, Zephr validates the token using the key in the Secret or Public Key field instead. If that succeeds, the session is authenticated as usual. Existing valid JWTs therefore continue to work until they expire or the user re-authenticates.
You can configure both a secret/public key and a JWKS endpoint at the same time. That supports migration when users still hold tokens signed with either method.