Skip to content
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

SDK does not check applicationId of UserInfo #160

Open
peter-greenatlas opened this issue Sep 5, 2024 · 0 comments
Open

SDK does not check applicationId of UserInfo #160

peter-greenatlas opened this issue Sep 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@peter-greenatlas
Copy link

SDK does not check applicationId of UserInfo

Description

If there are two applications (with different clientIds) running on the same domain, then the SDK will think the user is logged in, even if they are only signed into / registered for the other application.

This can be fixed by manually checking that the applicationId in the userInfo matches the clientId in the FusionAuthProviderConfig, but it feels like quite a gotcha and something that should be taken care of by the SDK.

Affects package

I've only tested with the ReactSDK, but appears to be a problem in the SDKCore

Affects versions

Tried only:

  • FusionAuth 1.52.1
  • @fusionauth/react-sdk: 2.4.0

Steps to reproduce

  • Create two applications in the Fusionauth admin panel
  • Create a React application following https://fusionauth.io/docs/sdks/react-sdk, set the clientID
  • Duplicate this React application, use the other clientID
  • Run both applications
  • User signs into app1
  • User navigates to app2 - it says they are signed in, and <RequireAuth withRoles={}/> will use the roles they were assigned in app1

Expected behavior

If a user signs into app1 and then navigates to app2, app2 should not show them as logged in

Additional context

I guess this could be considered a limitation of the Hosted Backend (that it only supports one clientId at a time), but it seems like it would be safer to check the applicationId. Rather than do this in the javascript client, would it make sense to either have /app/me take a clientId parameter, or add another endpoint that does?

Thanks

@peter-greenatlas peter-greenatlas added the bug Something isn't working label Sep 5, 2024
@synedra synedra self-assigned this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants