Skip to content

Comments

Implement multi organization context management support#374

Open
kavindadimuthu wants to merge 5 commits intoasgardeo:mainfrom
kavindadimuthu:feature/organization-context
Open

Implement multi organization context management support#374
kavindadimuthu wants to merge 5 commits intoasgardeo:mainfrom
kavindadimuthu:feature/organization-context

Conversation

@kavindadimuthu
Copy link
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 kavindadimuthu force-pushed the feature/organization-context branch from 55d5d64 to 492ab15 Compare February 20, 2026 05:53
@kavindadimuthu kavindadimuthu force-pushed the feature/organization-context branch from 492ab15 to 99dda63 Compare February 20, 2026 05:55
@kavindadimuthu kavindadimuthu marked this pull request as ready for review February 20, 2026 08:40
@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