A LinkedIn access token lasts 60 days, and a programmatic refresh token lasts 365 days from the day the member authorized the app. Using the refresh token gets a new 60-day access token, but it does not give the refresh token more time: its year keeps counting down from that first authorization. When the year is up, no amount of refreshing helps. The LinkedIn member has to go through LinkedIn's authorization again, which in etlmcp means pressing Reconnect. Plan for one reconnect a year per LinkedIn connection.
How the two lifetimes fit together
LinkedIn's refresh-token guide works through an example:
| Day after authorizing | Access token after a refresh | Refresh token left |
|---|---|---|
| 1 | 60 days | 365 days |
| 59 | 60 days | 306 days |
| 360 | 5 days | 5 days |
On the last row, the new access token cannot outlive the refresh token, so both end on the same day. The token response says how long each one has: expires_in for the access token and refresh_token_expires_in for the refresh token, both in seconds. The year is a ceiling, not a promise: LinkedIn says it may revoke either token at any time for technical or policy reasons, and expects the app to send the member back through the login screen when that happens.
Programmatic refresh tokens are not given to every app. LinkedIn offers them to approved Marketing Developer Platform partners; an app without them gets only the 60-day access token, and the member authorizes again every 60 days instead of every year.
What a reconnect looks like on LinkedIn's side
LinkedIn's 3-legged OAuth guide says the consent screen is skipped, and the member is sent straight back, when two things hold: the member is still signed in to LinkedIn, and the current access token has not expired. Otherwise the member signs in and approves again.
When a refresh token has expired or been revoked, LinkedIn's token endpoint answers with HTTP 400 and the code invalid_request, the same code it uses for a request that is missing a parameter. Only the message tells the two apart: LinkedIn's error table says the grant or refresh token sent "is invalid, expired or revoked", and the fix it gives is to have the member authenticate again so that a new refresh token is issued.
What etlmcp does
When the LinkedIn connector is available, etlmcp accepts a LinkedIn connection with or without a refresh token, because LinkedIn hands them out only to some apps.
With a refresh token. etlmcp renews the access token by itself shortly before it runs out, and keeps the stored refresh token when LinkedIn's answer carries none. It reads LinkedIn's 400 answer for the words that say the refresh token itself is invalid, expired or revoked, and treats that as a dead connection rather than as a fault it could retry. The connection and its sources are then marked as needing a reconnect with the reason access was revoked or has expired, scheduled syncs from them stop, and your organization's owners get one email titled "Reconnect LinkedIn".
etlmcp does not record when the refresh token's year ends, and its daily check for expiring connections skips LinkedIn connections that hold a refresh token, because they renew themselves. You therefore get no warning before the yearly limit: the first sign is the reconnect email, after a sync has already failed. The "access ends" date on the sources page is the end of the current access token. It moves forward each time etlmcp renews it, so it does not show the yearly limit either.
Without a refresh token. The connection works until its access token ends. etlmcp records that date, warns the owners before it, and asks for a reconnect once it has passed. Expiring connections covers those emails.
What you should do
- Note the day you connect LinkedIn and set your own reminder a little under a year later. etlmcp will not send one for a connection that renews itself.
- Reconnect before that day, as the same LinkedIn member who made the connection: etlmcp refuses a reconnect made as a different LinkedIn user. If that person may leave your company, plan the handover before the year runs out.
- If you missed the date, reconnect anyway. After a reconnect, etlmcp checks each source of the connection against LinkedIn again, and the next routine sync starts far enough back to cover the days missed while the connection was down, within your plan's history (plans). You need a backfill by hand only for days older than that.