Back

How can I extend the expiry of providerAccessToken when creating an OAuth2 session?

  • 0
  • Auth
  • Cloud
Ankit Maniya
19 Feb, 2025, 16:43

I'm using Google as the OAuth2 provider, and by default, the access token is valid for only 1 hour. Is there a way to configure a longer expiry when the token is first created, or do I need to handle token refreshing manually?

Any guidance on setting this up within Appwrite or best practices for managing longer OAuth sessions would be greatly appreciated!

TL;DR
- Google access tokens have a default 1-hour expiry. - To extend the expiry when creating an OAuth2 session, you may need to handle token refreshing manually. - Consider looking into Appwrite documentation for managing longer OAuth sessions or reach out to the community for best practices.
Steven
19 Feb, 2025, 16:58

There's a bug with Google and refresh tokens 😕

Ankit Maniya
19 Feb, 2025, 16:59

@Steven Thanks

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more