Skip to content

feat: Add support for direct public key JWT verification without JWKS discovery#212

Open
ankita10119 wants to merge 2 commits intomainfrom
SDK-7388
Open

feat: Add support for direct public key JWT verification without JWKS discovery#212
ankita10119 wants to merge 2 commits intomainfrom
SDK-7388

Conversation

@ankita10119
Copy link
Copy Markdown
Contributor

@ankita10119 ankita10119 commented Dec 19, 2025

Description

This PR adds support for directly providing a public key for JWT verification without requiring JWKS discovery or endpoints, addressing issue #133.

Currently, the library only supports:

  1. Using issuerBaseURL to fetch JWKS via discovery
  2. Manually providing jwksUri and issuer
  3. Symmetric keys via string secret

This change extends the secret parameter to accept KeyLike objects (public keys from Node's crypto module), enabling asymmetric JWT verification without network
dependencies.

  • Fixes publicKey without discovery #133

    Changes

    Core Implementation:

    • Updated JwtVerifierOptions.secret type from string to string | KeyLike
    • Modified validation logic in jwt-verifier.ts to distinguish between string secrets (symmetric) and KeyLike objects (asymmetric)
    • Updated get-key-fn.ts to handle KeyLike objects directly without conversion
    • Exported KeyLike type for user convenience

Testing

Describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

Please include any manual steps for testing end-to-end or functionality not covered by unit/integration tests.

Also include details of the environment this PR was developed in (language/platform/browser version).

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@ankita10119 ankita10119 requested a review from a team as a code owner December 19, 2025 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

publicKey without discovery

1 participant