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

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. 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.

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

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