# /api/v2/users/{id} returns google accessToken not refreshToken?

**URL:** <https://community.auth0.com/t/api-v2-users-id-returns-google-accesstoken-not-refreshtoken/120061>\
**Category:** Get Help\
**Tags:** clients, management-api\
**Created:** [November 2, 2023, 11:40am UTC](https://community.auth0.com/t/api-v2-users-id-returns-google-accesstoken-not-refreshtoken/120061 "2023-11-02T11:40:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dean2](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dean2/32/35668_2.png) [@dean2](https://community.auth0.com/u/dean2)\
**Post date:** [November 2, 2023, 11:40am UTC](https://community.auth0.com/t/api-v2-users-id-returns-google-accesstoken-not-refreshtoken/120061/1 "2023-11-02T11:40:57Z")

</div>

I am unsure if I need a refreshToken for google. Is there a way to call auth0 to get the accessToken once in a while? I need to call the gmail apis every so often on behalf of customer users. Will auth0 know to call out to google to get a new access token if the previous one expired. As this is a prototype, I am fine with just calling for an access token when I need to invoke an api right now.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [November 7, 2023, 5:19pm UTC](https://community.auth0.com/t/api-v2-users-id-returns-google-accesstoken-not-refreshtoken/120061/3 "2023-11-07T17:19:01Z")

</div>

Hey there @dean2 !

A bit old but this post has some good information on this topic:

> [@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…

Long story short, you need to pass the parameter `access_type=offline`, as well the `connection_scope` parameter with required scopes, when calling the Auth0 `/authorize` endpoint.

> [@dean2](#):
>
> Will auth0 know to call out to google to get a new access token if the previous one expired.

Auth0 doesn’t check for the expiration of tokens nor refresh them.

> **[Identity Provider Access Tokens](https://auth0.com/docs/secure/tokens/access-tokens/identity-provider-access-tokens#renew-third-party-tokens)**
>
> Understand third-party access tokens issued by identity providers after user authentication and how to use them to call the third-party APIs.

---

<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 21, 2023, 5:19pm UTC](https://community.auth0.com/t/api-v2-users-id-returns-google-accesstoken-not-refreshtoken/120061/4 "2023-11-21T17:19:43Z")

</div>

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