-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Description 📓
Since #1543 was closed for not following the template, here's my attempt
NextAuth.js can generate JWKs but currently does so with a symmetric HS512 key. In order for another application (e.g. API backend) to verify a JWT, it needs to know the signing key. Therefore, generated keys are basically useless and the key needs to be generated by hand and configured in both applications.
To avoid having to generate and copy the signing key, a private/public key pair could be generated by NextAuth.js instead, and the public key would be exposed by [...nextauth].js as jwks. See https://eu.battle.net/oauth/jwks/certs as an example of a JWKS endpoint and Auth0's Navigating RS256 and JWKS about how it works.
This way, consumers can look up the public key and verify the JWT without having the signing key configured.
How to reproduce ☕️
A non-existing feature can't be reproduced.
Contributing 🙌🏽
No, I am afraid I cannot help regarding this