I've noticed recently that our Google Drive resources suddenly start breaking every 1-2 months. When I re-authenticate with OAuth though through the Retool Re-Authenticate button, it fixes it. I suspect that the authorization keeps expiring, which is causing this issue.
Upon further investigating, it looks like while the access and refresh tokens are being given, the ID token isn't. This is the one discrepancy between my resource and the one documented in this forum post.
In the meantime, I've considered extending the access token lifespan as documented in the same post here. I'm not sure though if that will help though, as it should be a refresh token issue, not access token. My goal is for the authentication to last a full year, and have to re-authenticate on a specific day during our low season, like March 1.
I'm wondering, what's the cause of this authorization breaking? is it the refresh token? id-token? or a combination of both?
Thanks Paulo! Yes, it is a REST resource. I followed the documentation on the retool website on how to connect to Google with OAuth 2.0, in particular.
Thans for the debugging steps Paulo! I did as you said and everything worked as expected, including step 3 (no error message).
Do you know the lifespan for this refresh token? I'm curious if we can extend it to a full year, or if there's a way we don't need to manually re-authenticate OAuth at all.
From Google's forum: "By default, Google Cloud API tokens expire after 1 hour. However, you can request a longer expiration time of up to 12 hours by specifying the "expires_in" parameter when you authenticate."
We do have an advanced setting for the lifespan of the Access token:
I tried changing it to 12h but the response is always coming with a value of 3599 for expires_in. I initially thought this was a bug with Retool, but I found this on the same thread:
If we would like to extend the expiration time to 12h it may be a good idea to keep an eye on that thread. But for your needs of extending it to a year, Google does not support this.
I can't find the View in console button when I hover over the resource. I tried revoking the access token and refreshing, but I still can't see it even when it says its connected. I also tried clicking on Inspect, but didn't see anything in my console. How can I get the View in console to appear?
Also, is the 3599 for the access token? I believe it's the refresh token lifespan that's important, right? I'm wondering if there's a way to expand that to a year given the way Retool has set up its OAuth.