Skip to content

Conversation

@brionmario
Copy link
Member

Purpose

This pull request introduces a new generic decodeJwtToken method across the Asgardeo SDK, enabling consistent decoding of JWT token payloads in both JavaScript and React clients. It also updates interfaces and internal logic to use this new method instead of the previous decodeIdToken, and adds support for session management in embedded sign-in flows for Asgardeo V2. Minor code quality improvements and temporary debugging statements are also included.

JWT Token Decoding Support:

  • Added a generic decodeJwtToken method to the main client classes (AsgardeoSPAClient, AsgardeoAuthClient, and AsgardeoReactClient) and their respective interfaces, allowing for flexible decoding of JWT payloads. This replaces the older decodeIdToken usage throughout the codebase. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Implemented the decodeJwtToken method in both the main thread and web worker clients, ensuring compatibility across environments. [1] [2] [3] [4]

Session Management Enhancements:

  • Updated the React client to support manual session setting during embedded sign-in flows (for Asgardeo V2), using the decoded assertion (ID token) to populate session data. This is a temporary workaround until full platform support is available. [1] [2]
  • Added a setSession method to the client interfaces and implemented it in the React client for improved session management flexibility. [1] [2] [3]

Internal and Developer Experience Improvements:

  • Updated references from decodeIdToken to decodeJwtToken in authentication helpers and internal logic for consistency. [1] [2] [3]
  • Added documentation and examples for the new decodeJwtToken method in both the JavaScript and React SDKs. [1] [2] [3]
  • Minor code style fixes (e.g., semicolon consistency, improved error message formatting). [1] [2]

Debugging and Temporary Code:

  • Added temporary debugging statements to the React AsgardeoProvider context to assist with development and troubleshooting.
  • Commented out a validation call in getStorageManager (SPA client) for compatibility or debugging purposes.

Dependency and Import Updates:

  • Updated imports to include EmbeddedSignInFlowStatusV2 for React client enhancements.

These changes collectively improve the flexibility, maintainability, and developer experience of the Asgardeo SDK by standardizing JWT token decoding and enhancing session management.

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the CONTRIBUTING guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Unit tests provided. (Add links if there are any)

Security checks

@brionmario brionmario force-pushed the refactor-thunder-flows branch from e1cf22b to ccae9c4 Compare January 26, 2026 16:59
@asgardeo-github-bot
Copy link

🦋 Changeset detected

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

@brionmario brionmario merged commit d936242 into asgardeo:main Jan 27, 2026
3 of 6 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.

Embedded flow doesn't continue after completion in AsgardeoV2 (Thunder)

3 participants