Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for multiple Asgardeo Provider instances via optional instanceID #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kavindadimuthu wants to merge 2 commits into asgardeo:main
base: main
Choose a base branch
Loading
from kavindadimuthu:feat/multi-client-support

Conversation

@kavindadimuthu
Copy link
Contributor

@kavindadimuthu kavindadimuthu commented Jan 22, 2026
edited by brionmario
Loading

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

* Defaults to 0 for backward compatibility.
*/
instanceId?: number;
} No newline at end of file
Copy link
Member

@brionmario brionmario Jan 29, 2026
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add instanceId?: number; to the top most Config interface:

  • /packages/javascript/src/models/config.ts

Copy link
Contributor Author

@kavindadimuthu kavindadimuthu Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added instanceId?: number; to top most Config interface in @asgardeo/javascript package

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.

import {AsgardeoBrowserConfig} from '@asgardeo/browser';

export type AsgardeoReactConfig = AsgardeoBrowserConfig;
export type AsgardeoReactConfig = AsgardeoBrowserConfig; No newline at end of file
Copy link
Member

@brionmario brionmario Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export type AsgardeoReactConfig = AsgardeoBrowserConfig;
export type AsgardeoReactConfig = AsgardeoBrowserConfig;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@brionmario brionmario brionmario left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

feat: Support multiple Asgardeo Provider instances via optional instanceID

AltStyle によって変換されたページ (->オリジナル) /