-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Description
In a scenario where multiple AsgardeoProvider components are instantiated within a single application (to support multiple concurrent sessions/organizations), authenticated API calls (httpRequest) only succeed for the first initialized provider.
Attempts to make authenticated requests via the useAuthContext() hook from subsequent (second, third, etc.) AsgardeoProvider instances fail. It appears that the SDK's internal state or the HTTP client instance might be binding to the first provider's configuration and is not correctly switching context for subsequent providers.
Expected Behavior
The httpRequest method should function correctly for all AsgardeoProvider instances independently. The SDK should isolate the HTTP client, token storage, and configuration for each provider instance, allowing concurrent authenticated calls.
Actual Behavior
- Provider A (First Instance): API calls function as expected.
- Provider B (Subsequent Instances): API calls fail.
Steps to Reproduce
- Initialize a React application.
- Set up two distinct AsgardeoProvider instances (Provider A and Provider B) with different configurations/scopes.
- Authenticate successfully using Provider A.
- Authenticate successfully using Provider B.
- Execute an authenticated API call using httpRequest from Provider A. -> Result: SUCCESS.
- Execute an authenticated API call using httpRequest from Provider B. -> Result: FAIL.
Please select the area the issue is related to
@asgardeo/javascript, @asgardeo/browser, @asgardeo/react
Version
N/A
Environment Details (with versions)
No response
Reporter Checklist
- I have searched the existing issues and this is not a duplicate.
- I have provided all the necessary information.
- I have tested the issue on the latest version of the package.