DataConnectors icon indicating copy to clipboard operation
DataConnectors copied to clipboard

OAUTH2 Refresh token update not used in new access token requests

Open happycoder80 opened this issue 4 years ago • 4 comments

I have created a custom connector for an online ERP web service. The data refreshing works fine for the first 10 minutes and after 10 minutes the access_token is expired and a new access token is requested using the last stored refresh_token. The first call to get an access_token succeeds and the response contains the new access_token and a new refresh_token. This should be enough but for some reason, immediately after this request, another access_token request is done with the same refresh_token as the first call and, because the OAuth service as strict refresh_token checking, this fails. I checked the timing using Fiddler and the requests comes one after another so it should be possible to use the new refresh_token.

image

So my first question could there be something wrong with my code that causes the new refresh_token not being used?

And secondly why do the refresh_token calls happen so often? I found out that number refresh_token requests that it tries depend on the number of tables in the pbix file. But to my knowledge, it shouldn't be necessary to request a new token for each REST call right?

Can someone please let me know whether I'm doing something wrong or that it is a problem in the framework.

Thanks!

happycoder80 avatar Nov 25 '19 20:11 happycoder80