# How can I use Google API after logged in with Auth0?

**URL:** <https://community.auth0.com/t/how-can-i-use-google-api-after-logged-in-with-auth0/100748>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [February 17, 2023, 2:14pm UTC](https://community.auth0.com/t/how-can-i-use-google-api-after-logged-in-with-auth0/100748 "2023-02-17T14:14:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnguyen1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dnguyen1/32/42833_2.png) [@dnguyen1](https://community.auth0.com/u/dnguyen1)\
**Post date:** [February 17, 2023, 2:14pm UTC](https://community.auth0.com/t/how-can-i-use-google-api-after-logged-in-with-auth0/100748/1 "2023-02-17T14:14:22Z")

</div>

Hi, I’m building a full-stack application with the Front-end using Next.js and the backend using Express. I’ve successfully setup the authentication flow for Next.js with Auth0 using the library @auth0/nextjs-auth0.

Now I want to call Google Calendar API using Google Access Token retrieved by following this tutorial [Call IDP API](https://auth0.com/docs/authenticate/identity-providers/calling-an-external-idp-api). I’m able to successfully call Google Calendar API using the Google Access Token retrieved by following the tutorial, however, after 1 hour, the Google Access Token expires and I’m no longer able to use Google Calendar API. Is there a way that I can refresh the Google Access Token and continue using the API without asking the user to login again? I’ve spent days trying to figure this out. Really appreciate if anyone could help me with this.

---

<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:** [February 23, 2023, 2:13pm UTC](https://community.auth0.com/t/how-can-i-use-google-api-after-logged-in-with-auth0/100748/3 "2023-02-23T14:13:51Z")

</div>

Hi @dnguyen1,

Welcome to the Auth0 Community!

You should be able to solve for this by getting a Google Refresh Token. Here is a thread that covers it:

[Store and retrieve Google Refresh token - #5 by mathiasconradt](https://community.auth0.com/t/store-and-retrieve-google-refresh-token/28973/5)

---

<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:** [March 9, 2023, 2:13pm UTC](https://community.auth0.com/t/how-can-i-use-google-api-after-logged-in-with-auth0/100748/4 "2023-03-09T14:13:53Z")

</div>

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