Setting up a LinkedIn developer app for the API
A LinkedIn integration starts with an app in the LinkedIn Developer Portal associated with a LinkedIn Page. On the Products tab add Sign In with LinkedIn using OpenID Connect (openid, profile, email) and Share on LinkedIn (w_member_social), register the redirect URL on the Auth tab and copy the Client ID and Client Secret. These open permissions need no special approval.
Updated:
What do you need for the LinkedIn API?
A developer app associated with a LinkedIn Page, two self-serve products and one redirect URL. That's enough to sign a member in (OpenID Connect) and post on their behalf. Anything beyond the open permissions — the advertising API, for example — requires separate approval from LinkedIn.
LinkedIn's open permissions are only openid, profile, email and w_member_social. Other permissions and partner programs require an application.
LinkedIn's open API gives no access to private messages or Lead Gen Forms — Socialift doesn't offer these either.
How to create an app in the LinkedIn Developer Portal
Create the app
developer.linkedin.com → My apps → Create app. Enter the App name, LinkedIn Page (company page name or URL), Privacy policy URL and a logo, accept the terms and create the app. If you have no LinkedIn Page, create one first.
Verify the Page association
On the Settings tab click Verify → Generate URL, copy the link and send it to the Page super admin. The super admin has 30 days to approve or deny it. Certain products and functionality require this verification.
Add the products
On the Products tab add “Sign In with LinkedIn using OpenID Connect” (
openid,profile,email) and “Share on LinkedIn” (w_member_social). Both are self-serve and available to all developers.Add the redirect URL
On the Auth tab add your HTTPS callback address to Authorized redirect URLs. Rules: the URL must be absolute, can't contain
#, query parameters are ignored, and theredirect_uriin the request must match an entry in the list.Copy the Client ID and Client Secret
Both are on the Auth tab. Don't share the Client Secret, and never pass it in a URL or query string.
Check the scopes
The Auth tab shows the scopes currently available to the app. If a request contains a scope not assigned to the app, LinkedIn returns “Invalid scope”.
How to connect the LinkedIn app to Socialift
“Kalitlar” (Keys) → “LinkedIn app”
In the dashboard open “Kalitlar” and the “LinkedIn app” card. Paste the Redirect URI from the “Konsolga ko'chiring” (Copy to console) block into Auth → Authorized redirect URLs. LinkedIn has no webhook URL here — only the redirect URI.
Enter the Client ID and Client secret
“Scope'lar” (Scopes) is optional: when empty,
openid profile email w_member_socialis used. Any extra scope must already be granted to your app by LinkedIn.Click “Saqlash va tekshirish” (Save and verify)
Socialift sends a client credentials request to LinkedIn's token endpoint. A wrong ID or secret gets the key rejected. A “no app token for this client” response means the key is valid — that's normal for member sign-in apps.
Connect the account
In “Ulanishlar” (Connections) click “Ulash” (Connect) on the LinkedIn card. The access token lasts 60 days. LinkedIn issues programmatic refresh tokens only to a limited set of partners — without one, sign in again via “Ulash” before it expires.
Which scopes do you need and why?
| Scope | Product | What it allows | In the SDK |
|---|---|---|---|
openid | Sign In with LinkedIn using OpenID Connect | Authentication via OIDC, ID token | li.me |
profile | Sign In with LinkedIn using OpenID Connect | Name and profile picture (lite profile) | li.me |
email | Sign In with LinkedIn using OpenID Connect | Primary email address | li.me |
w_member_social | Share on LinkedIn | Post, comment and like on behalf of the member | li.create_post, li.delete_post |
r_member_social | Not an open permission — needs LinkedIn approval | Required by the SDK to read posts | li.posts |
Notes and limits
When several scopes are requested, the member consents to all of them at once. Requesting a scope set different from the one previously granted invalidates all previous access tokens.
LinkedIn keys in the Python SDK
LinkedIn.from_env() reads LINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET and LINKEDIN_API_VERSION.
import asyncio
import secrets
from socialift import LinkedIn
REDIRECT_URI = "https://example.com/auth/linkedin/callback" # same as Authorized redirect URLs
async def main() -> None:
# LINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET, SOCIALIFT_LICENSE_KEY
async with LinkedIn.from_env() as li:
state = secrets.token_urlsafe(32)
print(li.login_url(redirect_uri=REDIRECT_URI, state=state))
code = input("code: ") # the code lives 30 minutes
bundle = await li.exchange_code(code, redirect_uri=REDIRECT_URI)
me = await li.me(bundle.access_token)
await li.create_post(bundle.access_token, author=li.person_urn(me.id), text="Hello, LinkedIn!")
asyncio.run(main())Explicitly: LinkedIn(client_id="...", client_secret="..."). The SDK joins scopes with spaces, as LinkedIn expects.
Versioned /rest/* calls send the LinkedIn-Version header. LinkedIn supports each version for at least one year; if you get a deprecated-version error, pass a current one via api_version= or LINKEDIN_API_VERSION.
Common mistakes
- The redirect URL differs from the Auth tab entry or uses
http://— “Redirect_uri doesn't match”. - The required product isn't added on the Products tab — “Invalid scope”.
- Scopes joined with commas — LinkedIn expects a space-delimited list.
- The authorization code isn't exchanged right away — it expires after 30 minutes.
- The scope set changed and old tokens are expected to keep working — they're invalidated.
- Nobody tracks the 60-day token lifetime or plans for the missing refresh token.
- The Client Secret is sent from the frontend or in URL parameters.
Frequently asked questions
Where do I find the LinkedIn Client ID and Client Secret?
LinkedIn Developer Portal → My apps → your app → Auth tab. The same tab lists Authorized redirect URLs and the scopes granted to the app.
Do I need a company page to create a LinkedIn app?
Yes, the creation form asks for a LinkedIn Page; create one first if you don't have it. For certain products the Page super admin must also verify the app via the link from Settings → Verify.
Does w_member_social require review?
No. w_member_social comes with the “Share on LinkedIn” product, an open self-serve permission available to all developers. Other permissions, such as advertising, require an application and LinkedIn approval.
How long does a LinkedIn access token last?
All access tokens are currently issued for 60 days. Programmatic refresh tokens are enabled only for a limited set of partners; everyone else repeats authorization — if the member is logged in to LinkedIn and the token hasn't expired, the consent screen is skipped.
Can Socialift send LinkedIn private messages?
No. By default Socialift works with the member profile and posts on their behalf (w_member_social). LinkedIn's open API gives no access to private messages or Lead Gen Forms, so Socialift doesn't offer them.