OAuth tokens expire. Manual reauth is a chore. The fix is older than OAuth: refresh tokens. But most integrations skip them. The 60-day reauth cycle becomes operational toil that scales with API count.
LinkedIn OAuth 2.0 issues access tokens with 60-day TTL plus refresh tokens with 1-year TTL. Most code stores the access token only. When it expires, the integration breaks, the operator manually generates new token, copies to env file, restarts service. Three minutes of toil × every API × rotation period — the arithmetic gets tedious fast.
The fix is mechanical: store refresh_token, write a refresh helper that hits the OAuth endpoint with grant_type=refresh_token, persist new tokens, retry the original call. PAI's LinkedIn integration now does this automatically — 401 detected, refresh helper fires, new tokens saved, original call retries successfully. The operator forgets the integration exists. That's success.
Top comments (0)