node-oauth2-jwt-bearer
node-oauth2-jwt-bearer copied to clipboard
Chore: Implement token exchange
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