I am building a Zapier integration wherein I need to have the functionality of refreshing the authentication tokens based on a refresh token provided and stored in bundle.authData.refresh_token at the beginning (the very first API call with username, password). I am using session auth as the same seems to be the best fit in my use case though I found out refresh_token functionality is supported with oauth2 but the same is not provided by the backend API for which I am building the Zapier integration.
The backend API is providing an AuthResponse JSON which is having access_token and refresh_token and it is expected from the backend to refresh access_tokens every 15 mins using the refresh_token provided in the beginning.
I wrote code for authentication using the session-auth GitHub example by Zapier and added a trigger everything working fine the integration is passing all the tests too. But I know that the Zapier will not be able to poll for posts/ triggers subsequently as I need some way to refresh the Bearer token. Which I am finding no way of doing in the session auth system.
Best answer by dinesh_sharmaView original