Auth0-react, getAccessTokenSilently and incognito mode, how to fix it?

Hello everyone

I am building an app with React and have used the React sdk from Auth0. I save the token in localstorage and everything is fine in normal Chrome mode but in Incognito, due to third-party cookies, it does not work, the getAccessTokenSilently method does not work, how can I solve it so that it also works in incognito mode?

Attached screenshots of index.tsx and file that save token in localstorage


image

I know that I have to use the refresh token but I don’t know how to do it exactly… help is appreciated

Please include the following information in your post:

“name”: “@auth0/auth0-react”,
“version”: “1.10.1”,

“react”: “^17.0.2”,

Is this a feature request or bug report? If so, please create an issue directly in the corresponding GitHub repo. The Community SDK category is for general discussion and support.

Hi there @rafa welcome to the community!

Chrome incognito doesn’t allow for third party cookies which is why getAccessTokenSilently isn’t working. To solve this, you would need to look into using a Custom Domain this way there is no reliance on third party cookies.

Hope this helps!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.