How to auto-refresh access token after expiration?

I’ve just setup a google api resource, and it work.
It seems like the access token expire after 1h (as it’s supposed to by default, and i’m fine with that access token lifespan).
However my app ask for a new auth after that expiration delay, and I would like it to ask a new token from ggl automatically without asking the user to auth again. If I understand correctly it should be possible by using the refresh token (which you store according to retool doc).
Is there any way to force retool to refresh the token instead of asking the user to grant access again?
Could it be because “Share OAuth2.0 Credentials Between Users” was set to “Yes” that the token wasn’t refreshed automatically ?

Hmm we definitely attempt to refresh the token, even if “Share Credentials” is set to true.

let me try to repro this

ah hmm… it works for me (token refreshes without prompting me to login again)

so my resource looks like this (oauth 2.0, has “access token” and “refresh token” populated after i click the test integration button):


does your resource look roughly like this? im most curious whether or not “refresh token” is populated

In fact it seems to work once I’m in the editor view or embedded view.
It’s only on the “app view” that I get the message that you can see in attached picture (yet the api calls works fine). It’s that message which led me to believe that there was an issue with the refresh token, I should have started by trying to do an api call despite the message to provide a better feedback right away.
So it’s not a blocking issue, but it’s miss-leading as there is nothing wrong with the auth in that app. Moreover the message keep poping even after authenticating again. Video: https://www.loom.com/share/db7922e9c8fc4e0282be0265737553a2

thank you so much for the detailed repro! yeah you’re totally right, this was a bug on our end

i fixed it locally, and we’ll be deploying the fix tonight. i’ll let you know once it’s out

the fix is live @mojeer! could you try it and lmk if it works

It’s not, I emptied my cache and tried in private nav but there is still that infinite pop-up loop,
plus my access token and refresh token fields seems to remain empty when it used to be --encrypted-on-server-- as in your screenshot above

Everything seems fine today, thanks !!

excellent!! glad it works now :slight_smile: