Skip to content

Conversation

@kavindadimuthu
Copy link
Contributor

Purpose

This pull request introduces support for multiple authentication contexts ("multi-auth context") in the Asgardeo React SDK by adding an instanceId parameter throughout the authentication client and provider. This enables applications to manage multiple independent authentication sessions within the same app instance. The most important changes are grouped below:

Multi-auth context support:

  • Added an optional instanceId property to the AsgardeoReactConfig interface to allow configuration of multiple authentication contexts.
  • Updated the AsgardeoReactClient class to accept an instanceId in its constructor, store it, and provide a getInstanceId() method. The AuthAPI is now initialized with the instanceId as well.
  • Modified the AuthAPI class to accept and store an instanceId, pass it to the underlying SPA client, and expose a getInstanceId() method. [1] [2]
  • Updated the AsgardeoProvider React component to accept an optional instanceId prop (defaulting to 0), and to instantiate the AsgardeoReactClient with this value, ensuring correct context isolation.

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

@asgardeo-github-bot
Copy link

⚠️ No Changeset found

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go.

If these changes should result in a version bump, you need to add a changeset.

Refer Release Documentation to learn how to add a changeset.

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