Forum Academy Marketplace Showcase Pricing Features

Handling OAuth 2.0 Refresh Tokens

I have been working with OAuth2 User-Agent flow method of authentication for one of my Google APIs . Here is how I configured it -

Despite checking the access_type=offline option, I get an error about my token being expired. The APIs stop working after a day or two and the user doesn’t remain logged in forever. How to configure it so that it handles refresh tokens automatically?

Ecco that. Having the same problem.

Is this an issue when you are constructing the API calls or when the user is using the application?

We had the same issue multiple times.

Inexplicably, it randomly stops refreshing tokens. One user may have a valid one without reauthenticating even after 20 days, while another user’s token may expire in a day.

The best way to create a manual OAuth 2.0 flow.

1 Like

Hey @anshjain232 , what Google API are you trying to use? Google Drive?

In my case is Goggle Calendar