Sign In with LinkedIn granular OAuth scopes: legacy token access after refresh or re-authentication is undefined
0 reputation · 31 Mar 2022, 09:55 UTC
0 reputation · 31 Mar 2022, 09:55 UTC
Sign In with LinkedIn's current product issues granular OpenID Connect scopes such as openid, profile, and email, replacing legacy broad scopes like r_basicprofile that returned most member fields under a single grant. Migrating an existing integration means requesting each permission explicitly and collecting member consent per data class.
The unresolved part is what happens to integrations that still hold legacy grants. LinkedIn has not announced a fixed sunset date for grandfathered apps, and enforcement may vary by app tier, verification status, and region. It is therefore unclear whether a routine token refresh preserves the originally granted field access, or whether the next re-authentication narrows the grant to the current scope set. With no repeatable end-to-end development environment for these flows, behavior has to be confirmed through sandbox apps and a limited set of test members.
31275 reputation · 31 Mar 2022, 18:44 UTC
1. Refreshing a legacy‑scoped token: OAuth 2.0 dictates that a successful POST /oauth/v2/accessToken with a refresh_token returns a token that carries the same scope value that was originally granted. In practice, LinkedIn’s current implementation keeps the legacy scope set (e.g., r_basicprofile r_emailaddress) intact when you refresh an access token, so you continue to receive the same profile fields you had before the token expired.
2. Re‑authenticating (user logs in again): The grant you receive depends on the scope you request in the new authorization URL. If you request granular scopes (e.g., openid profile email), the new access token will contain only those scopes. If you still request legacy scopes, LinkedIn may accept the request and issue a legacy token, but this is not guaranteed; enforcement can vary by app tier, verification status, and region. The token’s scope claim is the reliable indicator of the granted permissions.
scope value unless the authorization server explicitly revokes or narrows it.scope claim that lists all permissions the token can use.scope claim in the access token before making profile‑dependent API calls.r_basicprofile r_emailaddress).scope value returned in the token response.curl -X POST https://www.linkedin.com/oauth/v2/accessToken \
-d grant_type=refresh_token \
-d refresh_token=<YOUR_REFRESH_TOKEN> \
-d client_id=<YOUR_CLIENT_ID> \
-d client_secret=<YOUR_CLIENT_SECRET>
Inspect the scope field in the refreshed response; it should match the original legacy scopes.openid profile email) and compare the new token’s scope claim. If it contains only the granular scopes, you’ve lost legacy fields.scope claim before making API calls that rely on legacy fields. If a required field is missing, prompt the user to re‑authorize with the necessary granular scope.To fine‑tune the guidance for your specific environment, please provide:
These details can influence whether legacy scopes are honored during refresh or re‑auth and whether LinkedIn has already enforced the granular‑scope migration for your app.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.