Hope you are doing good. I am working on the same method right now.
Currently, I’m working on react application where I have integrated auth0 login/signup, and also once users log in, they will select the organization and then will continue for the application.
Using this, I can allow use to login simply. but when they select any organization from the list, I will pass that organization id in getAccessTokenSilently method to get token silently for the organization.
That’s great to hear that everything is working outside of Incognito and Safari at least! i believe the issue you are seeing is related to the blocking of 3rd party cookies by both Chrome Incognito and Safari as outlined in our getAccessTokenSilentlydocumentation:
Note: Getting an Access Token silently without using Refresh Tokens will not work in browsers that block third-party cookies, such as Safari and Brave.
Thank you so much for your response. I have tried with useRefreshTokens=true and with this, it is working fine and returning a JWT token without any error, but we are missing the organization id in the token, although I have added organization in the getAccessTokenSilently method.
is there any other param I need to add there? Please guide me here. Thanks!
No, It isn’t been added before, because we don’t want specific organization login, login will be common. But after that, we will show the organization list in which the user will be part, and the user will select the organization.
And based on that we will fetch the new token which included the organization id so that can help us on the API side to identify the data.
Are you able to locate the org_id param in the /authorize request associated with the getAccessTokenSilently silently call?
I’d be curious to know if the org_id is indeed included as a claim in the ID Token if you about this the standard route - That is, by having a user log in and specify the Organization they belong to when they log in. If you’re interested in doing this our React sample app might be the easiest route.