# Get refresh token from Google using react-native sdk

**URL:** <https://community.auth0.com/t/get-refresh-token-from-google-using-react-native-sdk/123934>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [January 1, 2024, 3:33pm UTC](https://community.auth0.com/t/get-refresh-token-from-google-using-react-native-sdk/123934 "2024-01-01T15:33:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![abduncan0](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/abduncan0/32/53223_2.png) [@abduncan0](https://community.auth0.com/u/abduncan0)\
**Post date:** [January 1, 2024, 3:33pm UTC](https://community.auth0.com/t/get-refresh-token-from-google-using-react-native-sdk/123934/1 "2024-01-01T15:33:19Z")

</div>

Hi,

I have read a number of documentation pages on getting a refresh token using Google social login.

I haven’t been able to get the refresh token from Auth0’s identities.

Here is the code using the react-native sdk.

```auto
await authorize(
        {
          audience: ENVIRONMENT.API_AUDIENCE,
          scope: "openid profile email offline_access",
          additionalParameters: {
            "access_type": "offline",
            "connection_scope": "https://www.googleapis.com/auth/gmail.readonly,https://www.googleapis.com/auth/calendar.events",
          },
        },
      );

```

Could you tell me what I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 4, 2024, 9:13pm UTC](https://community.auth0.com/t/get-refresh-token-from-google-using-react-native-sdk/123934/3 "2024-01-04T21:13:09Z")

</div>

Hi @abduncan0,

You need to use the management API to get the user’s Google refresh token and you shouldn’t be doing this directly from a public client. You’ll want fetch this token from your backend/API.

There’s a good write up about it here (ignore the first posts, they are about getting an Auth0 refresh token. I linked to the correct post directly):

> [@Store and retrieve Google Refresh token](https://community.auth0.com/t/store-and-retrieve-google-refresh-token/28973/5):
>
> Please ignore my previous answer, as it only applies when you want to login with Google, but in your case you need to also call the Google APIs (such as calendar). Then of course, you’d need to deal with the Google tokens directly. So, sorry about the confusion here. So according to the docs, for Google, you would need to add access\_type: offline to the /authorize request: [Call an Identity Provider API](https://auth0.com/docs/connections/calling-an-external-idp-api#step-3-extract-the-idp-access-token) : For certain Identity Providers, Auth0 will store a Refresh Token which you can use to ob…

---

<div class="post-metadata">

**Author:** ![abduncan0](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/abduncan0/32/53223_2.png) [@abduncan0](https://community.auth0.com/u/abduncan0)\
**Post date:** [January 5, 2024, 12:56pm UTC](https://community.auth0.com/t/get-refresh-token-from-google-using-react-native-sdk/123934/4 "2024-01-05T12:56:27Z")

</div>

Hi @dan.woda,

I have used the management api to get the identities, but it only has the access token, not the refresh token.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [January 5, 2024, 5:12pm UTC](https://community.auth0.com/t/get-refresh-token-from-google-using-react-native-sdk/123934/5 "2024-01-05T17:12:57Z")

</div>

It sounds like you aren’t being returned the refresh token from google. Have you gone through the post I linked and confirmed you are sending the correct params with the request?

---

<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:** [January 19, 2024, 5:13pm UTC](https://community.auth0.com/t/get-refresh-token-from-google-using-react-native-sdk/123934/6 "2024-01-19T17:13:20Z")

</div>

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