Skip to main content
Socialift
Documentation sections
Setup

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

  1. 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.

  2. 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.

  3. 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.

  4. 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 the redirect_uri in the request must match an entry in the list.

  5. 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.

  6. 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

  1. “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.

  2. Enter the Client ID and Client secret

    “Scope'lar” (Scopes) is optional: when empty, openid profile email w_member_social is used. Any extra scope must already be granted to your app by LinkedIn.

  3. 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.

  4. 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?

Which scopes do you need and why? — Capability matrix by platform
ScopeProductWhat it allowsIn the SDK
openidSign In with LinkedIn using OpenID ConnectAuthentication via OIDC, ID tokenli.me
profileSign In with LinkedIn using OpenID ConnectName and profile picture (lite profile)li.me
emailSign In with LinkedIn using OpenID ConnectPrimary email addressli.me
w_member_socialShare on LinkedInPost, comment and like on behalf of the memberli.create_post, li.delete_post
r_member_socialNot an open permission — needs LinkedIn approvalRequired by the SDK to read postsli.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.

linkedin_login.py
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.

Sources

  1. LinkedIn: Getting Access to LinkedIn APIs
  2. LinkedIn: 3-Legged OAuth Flow
  3. LinkedIn: Sign In with LinkedIn using OpenID Connect
  4. LinkedIn: API versioning
  5. LinkedIn Help: Create a new app for a LinkedIn Page
  6. LinkedIn Help: App verification request

Related pages