FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Implement multi organization context management support by kavindadimuthu · Pull Request #374 · asgardeo/javascript · GitHub

Implement multi organization context management support - #374

Merged
DonOmalVindula merged 8 commits into
asgardeo:mainfrom
kavindadimuthu:feature/organization-context
Mar 6, 2026
Merged

Implement multi organization context management support#374
DonOmalVindula merged 8 commits into
asgardeo:mainfrom
kavindadimuthu:feature/organization-context

Conversation

Copy link
Copy Markdown
Contributor

Purpose

This pull request introduces multi-organization authentication context support, enabling users to authenticate and exchange tokens across different organization contexts. The main changes include improvements in session and storage management keyed by instance, and new configuration options and React components for organization chaining.

Multi-organization context and token exchange support:

  • Added organizationChain configuration to both BaseConfig and DefaultAuthClientConfig, allowing specification of sourceInstanceId and targetOrganizationId for chained authentication and token exchange between organizations. [1] [2]
  • Updated the exchangeToken and replaceCustomGrantTemplateTags logic to fetch session data from the appropriate organization context, using the organizationChain configuration to determine the correct instance for access tokens. [1] [2] [3] [4]

Session and storage management improvements:

  • Enhanced StorageManager to support resolving keys and retrieving session data based on both userId and instanceId, ensuring correct data isolation between organization contexts. [1] [2]

React SDK enhancements:

  • Added a new OrganizationContext React component to encapsulate organization context configuration and propagate it through the component tree, supporting nested/multi-organization scenarios.
  • Updated AsgardeoReactClient.switchOrganization to utilize the new organizationChain configuration and determine if sign-in is required based on the presence of a sourceInstanceId. [1] [2]

These changes collectively enable seamless authentication flows across multiple organizations, improve isolation of authentication state, and provide a more robust foundation for multi-tenant applications.

Related Issues

  • N/A

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

kavindadimuthu force-pushed the feature/organization-context branch 2 times, most recently from 492ab15 to 99dda63 Compare February 20, 2026 05:55
kavindadimuthu marked this pull request as ready for review February 20, 2026 08:40
await this._validateMethod();
} else {
await this._validateMethod();
// await this._validateMethod();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is this expected?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah. Here it checks the signedIn status in both paths unless config.signInRequired is explicitly true or false. So I intentionally removed that check from the else path.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Removed that else block

kavindadimuthu force-pushed the feature/organization-context branch from b0346fe to 13ab7c6 Compare February 23, 2026 05:11
kavindadimuthu force-pushed the feature/organization-context branch 2 times, most recently from 392669a to 6091a45 Compare February 24, 2026 09:09
…, and worker files

- Changed all occurrences of instanceID to instanceId in message.ts, spa-utils.ts, worker-core.ts, and worker-receiver.ts for uniformity.
- Added instanceId property to the Message interface in message.ts.

Copy link
Copy Markdown

🦋 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.

DonOmalVindula merged commit 53c9707 into asgardeo:main Mar 6, 2026
7 of 8 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

4 participants


Back | FazBrowse Home | New Git URL