Refresh Tokens not being fetched and store by oAuth2.0 or custom Auth

the oAuth process is not fetching and storing the Refresh Tokens though they are being returned by the API. details in screenshots below. would be nice if we could trace the entire HTTP callout exchange happening so the issue can be narrowed down.

1 Like

Hey @Venus!

Thanks for sharing those screenshots. A few questions to have a better understanding of what you're experiencing:

  • Are you able to share any errors you're receiving with the auth token not set correctly/refresh token not working?
  • Are you able to share what the response looks like when you click "Test auth workflow" to confirm that both variable is set correctly?

As a quick note, I don't believe Retool has the option at the moment to allow request for both an access_token and refresh_token, only access_token. I think you'll have to make this as a separate request using the Refresh Auth Workflow, which it looks like you've set up!

In your case, instead of{{ http1.body.refresh_token }}, it may be closer to something like {{ http1.body.oauth1.refresh_token }}

yes when i setup refresh auth workflow, its expecting the "auth code" which was returned by the original GET of Authorization URL ( NOT the accessToken ) , however the initial oAuth step ONLY returns the accessToken , how do i get the actual auth code which was returned/posted back by API provider to Retool's callback URL ?

@victoria any thoughts on above ?

Asking the team that builds our auth to make sure I’m replying with correct info! Will let you know as soon as I hear back, thank you for your patience here :pray:

For anyone following along, we've moved to a 1:1 thread to debug further! Will post any solutions here afterwards.

Any update on this? We had to abandon oAuth authorization due to not getting refresh tokens to work.

Hey @asojda_six15! I haven't been able to get in touch just yet, but this is the last message we exchanged:

1) When making the authorization call, it's returning an AccessToken + Authorization Code, is this correct?

2) You're not seeing the Authorization Code being returned in Retool along with the AccessToken?

If both are correct, then it doesn’t look like we can do this natively at the moment in Retool. A possible workaround to this may be to set up a custom auth workflow using Redirect to SSO. This will give you flexibility with defining variables with access to the redirect’s URL params. You can then access whatever variables you set in the requests, auth, and refresh auth flows.

Does this help at all? Let me know!

thanks , was able to resolve this using the "Redirect to SSO" - that provides the most flexibility.

1 Like