node-oauth2-jwt-bearer icon indicating copy to clipboard operation
node-oauth2-jwt-bearer copied to clipboard

Chore: Implement token exchange

Open ankita10119 opened this issue 3 weeks ago • 0 comments

Description

This pull request implements token exchange functionality as per the OAuth 2.0 Token Exchange RFC 8693. It introduces new logic to allow clients to exchange one token (e.g., a JWT) for another token, enabling support for a broader set of authentication flows and delegation scenarios.

Key Changes

  • Adds support for the OAuth 2.0 Token Exchange grant type.
  • New endpoint/method for exchanging tokens.
  • Updates internal validation and token processing logic to comply with RFC 8693.
  • (If applicable) Documents usage in the README or inline JSDoc.
  • (If applicable) Adds/updates tests covering token exchange flows and edge cases.

Testing

  • All existing tests pass.
  • New tests cover successful and failed token exchange cases, including various error conditions.

References

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 avatar Nov 10 '25 04:11 ankita10119