Access Oauth2 refresh token

Hi there

I want to send the oauth authentication tokens from retool to my API to do a gmail API request from there (as it's easier than in retool).

I've successfully added Oauth2 to my rest API.

Now I can send the magic variable OAUTH2_TOKEN to my backend, all fine.
Is there a way to also send the refresh token? Because to instantiate the credentials object in python I need this:

credentials = Credentials(
token=token,
refresh_token=refresh_token,
token_uri="https://www.googleapis.com/oauth2/v3/token",
client_id=client_id,
client_secret=client_secret,
)

Which needs the refresh token as well

Oh I found out, I don't need the refresh token in the backend :sweat_smile:

This works perfectly fine:

Credentials(
token=token,
token_uri="https://www.googleapis.com/oauth2/v3/token",
client_id=client_id,
client_secret=client_secret,
)
1 Like