Skip to content

Conversation

brionmario
Copy link
Member

Purpose

This pull request introduces support for token exchange functionality across the JavaScript, React, and Next.js SDKs for Asgardeo. The main changes include adding a new exchangeToken method to the core client interfaces and implementations, updating context types and providers to expose this method, and ensuring proper type imports and usage throughout the codebase.

Token Exchange Feature Integration

  • Added the exchangeToken method to the AsgardeoClient interface and its abstract implementation in AsgardeoJavaScriptClient, enabling token swapping based on a provided configuration. [1] [2]
  • Implemented the exchangeToken method in both AsgardeoReactClient and AsgardeoNextClient, delegating to the underlying Asgardeo client and handling session IDs as needed. [1] [2]

Context and Provider Updates (React SDK)

  • Extended the AsgardeoContextProps type and the default context value to include the new exchangeToken method, making it available to React consumers. [1] [2]
  • Bound the exchangeToken method to the context provider, ensuring it is correctly exposed to all components using the context.

Type and Import Adjustments

  • Updated imports to include TokenExchangeRequestConfig wherever token exchange functionality is used, ensuring type safety and consistency in all relevant files. [1] [2] [3] [4] [5] [6]

Next.js Server Integration

  • Added an exchangeToken utility to the Next.js server-side asgardeo.ts helper, allowing server-side code to perform token exchanges using the SDK.

These changes collectively enable secure and flexible token exchange operations for applications using the Asgardeo SDKs.

Related Issues

Related PRs

  • N/A

Checklist

  • e2e cypress tests locally verified.
  • Manual test round performed and verified.
  • UX/UI review done on the final implementation.
  • Documentation provided. (Add links if there are any)
  • Unit tests provided. (Add links if there are any)
  • Integration tests provided. (Add links if there are any)

Security checks

@brionmario brionmario merged commit 34f76ce into asgardeo:main Sep 4, 2025
2 of 4 checks passed
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.

2 participants