[GH-ISSUE #6972] [oauth-provider] the jwks_uri should respect jwksPath from jwt plugin #10687

Closed
opened 2026-04-13 06:58:20 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @alexdonh on GitHub (Dec 24, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/6972

Is this suited for github?

  • Yes, this is suited for github

It's about the auth server metadata where jwks_uri is defined.

Describe the solution you'd like

Firstly, kudos to @dvanmali for the oauth-provider an oauth 2.1 compliant plugin!

i was just wondering if it makes a little more sense to respect the jwksPath of jwt plugin when building metadata:

0492750c7e/packages/oauth-provider/src/metadata.ts (L30)

instead of

jwks_uri: overrides?.jwt_disabled
    ? undefined
    : (opts?.jwks?.remoteUrl ?? `${baseURL}/jwks`),

do

jwks_uri: overrides?.jwt_disabled
    ? undefined
    : (opts?.jwks?.remoteUrl ?? `${baseURL}/${opts?.jwks?.jwksPath ?? "jwks"}`),

Describe alternatives you've considered

N/A

Additional context

No response

Originally created by @alexdonh on GitHub (Dec 24, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/6972 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. It's about the auth server metadata where `jwks_uri` is defined. ### Describe the solution you'd like Firstly, kudos to @dvanmali for the `oauth-provider` an oauth 2.1 compliant plugin! i was just wondering if it makes a little more sense to respect the `jwksPath` of `jwt` plugin when building metadata: https://github.com/better-auth/better-auth/blob/0492750c7e5e3ea7c188111a6e5fa82f793c7427/packages/oauth-provider/src/metadata.ts#L30 instead of ``` jwks_uri: overrides?.jwt_disabled ? undefined : (opts?.jwks?.remoteUrl ?? `${baseURL}/jwks`), ``` do ``` jwks_uri: overrides?.jwt_disabled ? undefined : (opts?.jwks?.remoteUrl ?? `${baseURL}/${opts?.jwks?.jwksPath ?? "jwks"}`), ``` ### Describe alternatives you've considered N/A ### Additional context _No response_
GiteaMirror added the locked label 2026-04-13 06:58:20 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Dec 24, 2025):

Thank you for your issue description! It looks like you've identified a potential improvement regarding the jwks_uri in the metadata configuration for the MCP plugin, specifically in how it could respect the jwksPath from the jwt plugin.

To proceed, it seems that the suggestion is to modify the logic of how jwks_uri is constructed. Rather than directly linking to the default JWKS endpoint, your proposal suggests incorporating the customizable jwksPath. This adjustment appears to be relevant considering there are existing discussions and an open issue about ensuring that configurations are correctly reflected across the plugins involved, especially when using JWT.

Since this enhancement might require further deliberation and technical evaluation, I recommend waiting for feedback or further input on this suggestion from the Better Auth team. You can tag @bekacru or @ping__ for more insights or details regarding this implementation.

How does this approach align with your expectations, and do you have any additional questions or related topics you'd like to discuss?

If you need more help, tag @better-auth-agent in a comment so I can respond.

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3688674499 --> @better-auth-agent[bot] commented on GitHub (Dec 24, 2025): Thank you for your issue description! It looks like you've identified a potential improvement regarding the `jwks_uri` in the metadata configuration for the `MCP` plugin, specifically in how it could respect the `jwksPath` from the `jwt` plugin. To proceed, it seems that the suggestion is to modify the logic of how `jwks_uri` is constructed. Rather than directly linking to the default JWKS endpoint, your proposal suggests incorporating the customizable `jwksPath`. This adjustment appears to be relevant considering there are existing discussions and an open issue about ensuring that configurations are correctly reflected across the plugins involved, especially when using JWT. Since this enhancement might require further deliberation and technical evaluation, I recommend waiting for feedback or further input on this suggestion from the Better Auth team. You can tag @bekacru or @ping__ for more insights or details regarding this implementation. How does this approach align with your expectations, and do you have any additional questions or related topics you'd like to discuss? _If you need more help, tag @better-auth-agent in a comment so I can respond._ <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) • [Discord](https://discord.gg/fG2XXEuQX3) • [GitHub](https://github.com/Skyvern-AI/Skyvern) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/fG2XXEuQX3) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/Skyvern-AI/Skyvern)
Author
Owner

@dvanmali commented on GitHub (Dec 24, 2025):

Thanks so much @alexdonh! And nice catch, will patch shortly!

<!-- gh-comment-id:3690328830 --> @dvanmali commented on GitHub (Dec 24, 2025): Thanks so much @alexdonh! And nice catch, will patch shortly!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#10687