-
Notifications
You must be signed in to change notification settings - Fork 288
Description
Checklist
- The issue can be reproduced in the auth0-react sample app (or N/A).
- I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
Description
Hi,
I already created an issue in the spa.js library auth0/auth0-spa-js#1457
The change to store the id token per client id and not per audience was by design.
The proposed solutions, however, are not that easily doable in combination with auth0-react because there is no easy way to access the access token claims / scopes of the Auth0Provider.
In order to help it should be possible to access the access token data which would be fine in our use case as the scopes etc. are valid for the SPA access token and used to show corresponding data.
However, the id token is replaced on another audience call, which creates issues as they should not have all scopes the SPA has by design, only the ones relevant for that API.
See issue: auth0/auth0-spa-js#1457
Reproduction
- Use latest auth0-spa-js
- use latest auth0-react
- Use SPA with audienceA
- Use API with audienceB
- Add scopes/claims to access token (and id token) of audienceA, but not audienceB
- call getAccessToken... with audienceB manually before calling that API.
The user object of audienceA is lost as it is replaced with audienceB.
Furthermore, as there is no way to access claims/scopes etc. of the access token of audienceA, there is no easy way around this.
See issue: auth0/auth0-spa-js#1457
Additional context
See issue: auth0/auth0-spa-js#1457
auth0-react version
2.9.0
React version
19
Which browsers have you tested in?
Chrome