APIs & Integrations

HarshalDhamale
Member

Able to use same access token for HubSpot linked service after expiration date to get data in ADF

In my case, initally I generated an access token and refresh token using a node application and store it in key vault of azure. Then I expose one endpoint which helps me to generate new access token from refresh token, if access token expire, I pull out refresh token from key vault and pass to HubSpot endpoint to get new fresh access token and refresh token and store it in key vault else if previous access token not expired then simply get previous access token stored in key vault. Again I save New Access and refresh token to Azure key vault. I used this Access token in HubSpot linked service to get contacts data from HubSpot to ADF. 

Here in this case even if I used an access token which is expired, still I am able to get the data from my HubSpot instance. How this could be possible? 

0 Upvotes
1 Reply 1
KhushbooRevOps
Participant

Able to use same access token for HubSpot linked service after expiration date to get data in ADF

Hi @HarshalDhamale,

That’s definitely weird! Normally, an expired access token should throw a 401 error, and you’d need to use the refresh token to get a new one.

A few reasons why it might still be working,

HubSpot might have a short grace period after token expiration where it still accepts the old one—basically like a buffer. Sometimes, tokens can have a little delay in being marked as expired, especially if you’re refreshing it super fast.

HubSpot could be caching the session or allowing requests to go through temporarily even if the token’s expired.

What you can do?
Check the response headers/status codes when you make requests. Maybe there’s a clue in there if it’s about to expire or something. To avoid this confusion, consider refreshing the token a few minutes before it actually expires. That way, you’re always using a fresh one.

If it’s still acting up, HubSpot support might have more insight into what’s going on under the hood.

I hope it helps, let me know if you need to talk!

Khushboo Pokhriyal

Growth & Operations

GroRapid Labs

LinkedIn | 9315044754 | Email | Website

0 Upvotes