Skip to content

Provide JWKS Endpoint and generated RS256 keys #3150

@micheljung

Description

@micheljung

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions