[GH-ISSUE #1277] Add alg to JWKS endpoint. #8671

Closed
opened 2026-04-13 03:49:40 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @shadiramadan on GitHub (Jan 24, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1277

Lot's of libraries that validate JWKS require alg be set (for example in tink-go JWKSetToPublicKeysetHandle)

It should be fairly straightforward to pass in the alg -
I would actually add it to:
https://github.com/better-auth/better-auth/blob/05d586ea58bac45abaa04cd99e4bd755acacb642/packages/better-auth/src/plugins/jwt/index.ts#L176

const alg = options?.jwks?.keyPairConfig?.alg ?? "EdDSA";
publicKey: JSON.stringify({
  alg,
  ...publicWebKey
}),

So that it is properly saved to the Jwks table.

Originally created by @shadiramadan on GitHub (Jan 24, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1277 Lot's of libraries that validate JWKS require `alg` be set (for example in tink-go [JWKSetToPublicKeysetHandle](https://pkg.go.dev/github.com/tink-crypto/tink-go/v2/jwt#JWKSetToPublicKeysetHandle)) It should be fairly straightforward to pass in the `alg` - I would actually add it to: https://github.com/better-auth/better-auth/blob/05d586ea58bac45abaa04cd99e4bd755acacb642/packages/better-auth/src/plugins/jwt/index.ts#L176 ```typescript const alg = options?.jwks?.keyPairConfig?.alg ?? "EdDSA"; ``` ```typescript publicKey: JSON.stringify({ alg, ...publicWebKey }), ``` So that it is properly saved to the Jwks table.
GiteaMirror added the lockedstale labels 2026-04-13 03:49:40 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 11, 2025):

Hi, @shadiramadan. I'm Dosu, and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You suggested enhancing the Better Auth library by including the alg parameter in the JWKS endpoint.
  • This addition is necessary for compatibility with libraries like tink-go.
  • Proposed implementation involves modifying the code to incorporate alg with a default value of "EdDSA".
  • No further activity or comments have been made on this issue.

Next Steps:

  • Please let me know if this issue is still relevant to the latest version of the better-auth repository by commenting here.
  • If there is no response, the issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:2963384251 --> @dosubot[bot] commented on GitHub (Jun 11, 2025): Hi, @shadiramadan. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You suggested enhancing the Better Auth library by including the `alg` parameter in the JWKS endpoint. - This addition is necessary for compatibility with libraries like tink-go. - Proposed implementation involves modifying the code to incorporate `alg` with a default value of "EdDSA". - No further activity or comments have been made on this issue. **Next Steps:** - Please let me know if this issue is still relevant to the latest version of the better-auth repository by commenting here. - If there is no response, the issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8671