What to do when you suddenly get BAD_REFRESH_TOKEN when trying to refresh an access token
Aug 21, 2017 5:11 AM
We have one of our applications tightly integrated with HubSpot which means that for quite some requests to our app we do a request over the API to HubSpot. For that we use the Oauth2 authentication scheme. We store our access and refresh token together with the validity period of the access token, when the access token is expired we automatically refresh it using the refresh token.
However, recently, out of the blue, when our app tried to refresh the access token HubSpot returned the status “BAD_REFRESH_TOKEN”. We had to reintegrate our app with HubSpot to get around it (manual intervention!). Unfortunately the HubSpot documentation does not mention this error status at all…
My question is now: Do refresh tokens expire? How can we automatically (without manual intervention) react to such a situation? Un