Updated recommendations for storing OAuth access tokens

We’re updating our recommendation for storing access tokens to allow tokens to be at least 512 characters in length.

Why is this changing?

Access tokens can fluctuate in size based on the information encrypted in the tokens, which continues to grow as we expand the HubSpot platform.

When is this happening?

We don’t expect to hit 300 characters for access tokens for the next several months, but if the database you use to store tokens is limited to 300 characters, we recommend increasing that limit to at least 512 characters to avoid any potential issues.

Our previous recommendation of 300 characters has been in place since 2018, so we expect 512 characters to give us plenty of room to grow for the foreseeable future.

Please let us know if you have any questions by replying below.

4 Likes

Thank you for the info. Recently got error when check the exactly you mentioned happened limit 300 and access_token for 392 chars. It would be better to mention in the Oauth doc/reference link.

Thanks for the update. Expanding token storage to at least 512 characters now is a good preventive step and should help avoid future issues as token sizes grow.

Thanks for the advance notice. Updating the database field before token sizes actually increase is much easier than dealing with unexpected production issues later. It would also be helpful if the OAuth documentation and migration guides highlighted the 512-character recommendation so developers can catch it during implementation instead of after deployment.