# Unable to get react-native-auth0 access token on web

**URL:** <https://community.auth0.com/t/unable-to-get-react-native-auth0-access-token-on-web/193476>\
**Category:** Get Help\
**Tags:** react-native-auth0, sdks-quickstarts\
**Created:** [October 21, 2025, 11:13pm UTC](https://community.auth0.com/t/unable-to-get-react-native-auth0-access-token-on-web/193476 "2025-10-21T23:13:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coryfin13](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/coryfin13/32/77127_2.png) [@coryfin13](https://community.auth0.com/u/coryfin13)\
**Post date:** [October 21, 2025, 11:13pm UTC](https://community.auth0.com/t/unable-to-get-react-native-auth0-access-token-on-web/193476/1 "2025-10-21T23:13:01Z")

</div>

I’m building an expo app that targets the Android and web platforms. I’m using react-native-auth0 to enable the user to login with their Google account. The app then uses `getCredentials` to retrieve the access token so it be sent with requests to a REST API.

This is working on Android, but on web I get a “consent\_required” error.

When I logged in, I navigated through what looked liked a consent screen. Why am I getting the consent error in the app? Here are snippets of my implementation:

```typescript
// app/src/app/login.tsx

import { useRouter } from "expo-router";
import { ActivityIndicator, Text, View } from "react-native";
import { useAuth0 } from "react-native-auth0";
import { Button } from "react-native-paper";
import { useState } from "react";

export default function Login() {
  const { error, authorize } = useAuth0();
  const [pending, setPending] = useState(false);
  const router = useRouter();

  async function login() {
    setPending(true);
    const credentials = await authorize({ audience: 'https://myapi.com' });
    if (credentials) {
      router.replace('./(logged-in)');
    } else {
      setPending(false);
    }
  }

  if (pending) {
    return <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <ActivityIndicator size={72}/>
    </View>;
  }

  if (error) {
    console.error(error);
    return <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <Text style={{ fontSize: 18, marginBottom: 48 }}>An error occured while logging in.</Text>
      <Button
        mode="contained"
        onPress={login}
      >
        Try Again
      </Button>
    </View>
  }

  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <Text style={{ fontSize: 24, marginBottom: 48 }}>Welcome!</Text>
      <Button
        mode="contained"
        onPress={login}
      >
        Login
      </Button>
    </View>
  );
}

```

```typescript
// app/src/app/_layout.tsx

import { Slot } from "expo-router";
import { Auth0Provider } from "react-native-auth0";
import { PaperProvider } from "react-native-paper";

export default function RootLayout() {
  return <Auth0Provider
    domain="..."
    clientId="..."
  >
    <PaperProvider>
        <Slot/>
    </PaperProvider>
  </Auth0Provider>;
}

```

```typescript
// app/src/app/(logged-in)/_layout.tsx

import { Redirect } from "expo-router";
import { useAuth0 } from "react-native-auth0";
import { View, ActivityIndicator } from "react-native";
import { useEffect } from "react";
import { Text } from "react-native-paper";

export default function LoggedInLayout() {
  const { user, isLoading, getCredentials } = useAuth0();

  useEffect(() => {
    async function getAccessToken() {
      const credentials = await getCredentials();
      console.log('Access Token:', credentials.accessToken);
    }

    if (user) {
      getAccessToken();
    }
  }, [user]);

  if (isLoading) {
    return <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <ActivityIndicator size={72}/>
    </View>;
  }

  if (!user) {
    return <Redirect href="/login" />;
  }

  return <Text>Welcome, {user.name}!</Text>
}

```

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [October 24, 2025, 4:21pm UTC](https://community.auth0.com/t/unable-to-get-react-native-auth0-access-token-on-web/193476/3 "2025-10-24T16:21:25Z")

</div>

Hi @coryfin13

Welcome to the Auth0 Community!

Whenever you try to retrieve the user credentials using `getAccessToken`, `getAccessTokenSilently` or when they are redirected to authorization, are you passing in the correct audience or scopes every time?

Also, if you go to your APIs settings inside the Auth0 Dashboard, if you enable **Allow Skipping User Consent** , does the issue persist or not?

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [October 31, 2025, 7:45pm UTC](https://community.auth0.com/t/unable-to-get-react-native-auth0-access-token-on-web/193476/4 "2025-10-31T19:45:01Z")

</div>

Since I haven’t heard from you for a while @coryfin13, I will be marking the above reply as the solution to the thread.

If you will still need assistance on this matter, please send me a DM to reopen to the topic if it gets closed or just reference this one in your new one!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [November 14, 2025, 7:45pm UTC](https://community.auth0.com/t/unable-to-get-react-native-auth0-access-token-on-web/193476/5 "2025-11-14T19:45:58Z")

</div>

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