Auth0-react SDK: GetAccessTokenSilently returns error "Login required" in private browser

Hey all,

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.

Here are information about SDK I’m using:

  • SDK name - “@auth0/auth0-react”
  • SDK Version - “^1.9.0”
  • react - “^17.0.2”

And I have declared the required config parameters in Auth0Provider,

{
domain: ‘DOMAIN’,
clientId: ‘CLIENT_ID’,
redirectUri: ‘LOCATION’,
audience: ‘IDENTIFIER_STRING_VALUE’,
cacheLocation: ‘localstorage’,
onRedirectCallback
}

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.

await getAccessTokenSilently({
organization: ‘ORGANIZATION_ID’,
ignoreCache: true
});

Now issue is that it is working fine in chrome and firefox, but when I check with chrome incognito or safari, It is not working and keep returning an error “Login Required”.

Am I missing anything? Please help me with this. Thanks!