-
Goal: Connect Retool with SignNow API, using Custom Auth.
-
Steps:
- I have built a connection for the SignNow API using a REST Resource with Custom Auth for authentication (the OAuth2 type didn't match the needed fields at Generate access token | signNow)
- I set up the correct Headers, including the basic authorization token, and JSON Body, including the account username, password and grant_type.
- I stored values from the response into variables
ACCESS_TOKEN
,REFRESH_TOKEN
andEXPIRATION
. - I set up the Refresh auth workflow with the same headers, but a different body (grant_type to
refresh_token
) and set it to also save the response values to variablesACCESS_TOKEN
andEXPIRATION
. - When I test the Auth flow and Refresh in the connection, both work.
- When I actually go use the Resource, it works for awhile, until the first token expires. Then I get a 401 error with message
Custom Auth tokens expired. Last authenticated Infinity seconds ago with expiry of 0 seconds
.
-
Question:
- Is there a trick to getting the refresh auth flow to overwrite the existing variables with new values? Particularly the
ACCESS_TOKEN
andEXPIRATION
need to be changed when they are refreshed. - Are there any known differences between clicking Test in the Connection and running in a workflow? I have noticed that actually getting the Test buttons to be enabled requires toggling an environment and then hitting save (also noted at Can't setup custom API auth with bearer token - #2 by Alex_McAndrew)
- Is there a trick to getting the refresh auth flow to overwrite the existing variables with new values? Particularly the
-
Screenshots:
Hello @jlevinger!
Bummer that OAuth2 didn't match the needed fields
From your last screenshot it looks like you need to add in the REFRESH TOKEN
as another step to the 'refresh auth workflow'.
When the refresh flow runs it should automatically replace the variables when new updated ones are returned from the auth provider on success of the refresh flow.
Also for your second question I do not believe there is any difference between clicking Test in the connection and running the refresh workflow. That is a known 'quirk' where after you save in the resource set up that users need to refresh the page