I’m using auth0-react
of Version - 1.2.0
After successfully authenticating, I’m fetching the accessToken for the backend api using the getAccessTokenSilently
-
const token = await auth0.getTokenSilently({
audience: "https://xxxx.api"
});
I’m able to retrieve token in Chrome and Firefox. But in incognito windows (in Chrome) or in Safari, there is an error - “Error: Login required”
I’ve followed other solutions with similar problem and I’ve enabled the refresh token rotation in my SPA settings -
Also in my react application I’ve added the refreshToken attribute as well -
<Auth0Provider
domain="xxxx.au.auth0.com"
clientId="xxxxxxx"
redirectUri={"https://polite-goat-11.loca.lt"}
scope="profile email openid"
useRefreshTokens={true}
cacheLocation="localstorage"
onRedirectCallback={onRedirectCallback}
>
Also in my API I’ve enabled the allow offline access -
But still I’m getting the same error.
Can you guys please help me to fix the problem ?
Thanks