Login failed in Incognito window in chrome

Hey,

Currently, I’m working on react application where I have integrated auth0 login/signup but failed to login in the Incognito window in google chrome.

Getting errors like login_required

  • Tried useRefreshTokens too but in that scenario getting a Refresh token missing error.

Here is information about SDK I’m using:

  • SDK name - “@auth0/auth0-react”
  • SDK Version - “^2.2.0”
  • react - “^18.2.0”

Here’s the implementation

    <Auth0Provider
      domain={getAuth0Creds().domain}
      clientId={getAuth0Creds().clientId}
      authorizationParams={{
        redirect_uri: window.location.origin,
        connection: 'email',
        scope: getAuth0Creds().scope
      }}
    >
        <ApolloProvider client={apolloClient}>
          <CustomContexts>
            <BrowserRouter>
              <RoutesMain />
            </BrowserRouter>
          </CustomContexts>
        </ApolloProvider>
    </Auth0Provider>

And using these methods in routes file

  const { getIdTokenClaims, getAccessTokenSilently, isAuthenticated } =
    useAuth0();
  useEffect(() => {
    const getToken = async () => {
      try {
        await getAccessTokenSilently();
        const idToken = await getIdTokenClaims();
        if (idToken) {
          localStorage.setItem('ACCESSTOKEN', JSON.stringify(idToken?.__raw));
        }
      } catch (error) {
        if (!isAuthenticated && error) {
          navigate(PATH.AUTH, { replace: true });
        }
      }
    };
    void getToken();
  }, [getAccessTokenSilently, getIdTokenClaims, isAuthenticated]);

@dan.woda Please reply on this issue.

Hey,
I have added a custom domain as per a few comments in the auth0 community team.
Still, I’m facing a login issue in the incognito window.
What else could I be missing here? Please let me know.

Then added the domain here

    <Auth0Provider
      domain='auth.ubiquitousinfluence.app'
      clientId={getAuth0Creds().clientId}
      authorizationParams={{
        redirect_uri: window.location.origin,
        connection: 'email',
        scope: getAuth0Creds().scope
      }}
    >
      <ApolloProvider client={apolloClient}>
        <CustomContexts>
          <BrowserRouter>
            <RoutesMain />
          </BrowserRouter>
        </CustomContexts>
      </ApolloProvider>
    </Auth0Provider>