Access token and refresh token flow with react-native-auth0

Hey,

I am trying to create a authentication flow in a react-native-app with react-native-auth0. I am unfortunately not receiving any refresh token with my access token.

Things I have done:

  1. Enabled Refresh Token Rotation on my native application
  2. Send offline_access as scope:
await authorize(
        {
          scope: 'openid profile email offline_access',
          additionalParameters: {
            ui_locales: selectedLocale,
          },
        },
        {ephemeralSession: true},
      );

Additionally, I am checking the authentication state of the user through the Auth0 hook’s function hasValidCredentials but after login the value switches to true and flips back to false.

Any help on understanding this better is really really appreciated. Thanks@

Hi Manya,

could you please check if your Auth0 client application have refresh token grant enabled? Also if you are specifying an audience value, you need to have the “Allow Offline Access” setting enabled. See this: API Settings

1 Like