Skip to content

LinkedIn Setup

Connect your LinkedIn profile to POSSE Post so it can publish posts on your behalf.

What you need

  • A LinkedIn developer app with the Share on LinkedIn and Sign In with LinkedIn using OpenID Connect products enabled
  • Your app's Client ID and Client Secret
  • Your Person URN (a value like urn:li:person:abcd1234 that identifies your LinkedIn profile)

Steps

  1. Create a LinkedIn app
  2. Enable required products
  3. Configure OAuth settings
  4. Copy your credentials
  5. Look up your Person URN
  6. Add LinkedIn to POSSE Post
  7. Authorize POSSE Post

Step 1: Create a LinkedIn app

  1. Visit developer.linkedin.com and click Create app.
  2. Fill out the app details and click Create app:
  3. App name (e.g. POSSE Post)
  4. A LinkedIn Company Page to associate with the app (required — create one if needed)
  5. App logo
  6. Accept LinkedIn's terms

Step 2: Enable required products

  1. On your app's overview page, find the Share on LinkedIn product and click Request access. Agree to the terms.
  2. Find Sign in with LinkedIn using OpenID Connect and click Request access. Agree to the terms.

Both products should show as active within a few minutes.

Step 3: Configure OAuth settings

  1. On your app page, go to the Auth tab.
  2. Under OAuth 2.0 settings, click the pencil icon next to Authorized redirect URLs for your app.
  3. Add your site's callback URL:

https://your-site.com/posse-post/oauth/linkedin

  1. Click Update.

Step 4: Copy your credentials

On the Auth tab, copy your:

  • Client ID — shown at the top of the Auth tab
  • Client Secret — click the eye icon to reveal it

Add the client secret to your .env file:

LINKEDIN_CLIENT_SECRET=your_client_secret_here

Step 5: Look up your Person URN

POSSE Post needs your Person URN to post as your profile. You can look it up using a temporary access token from LinkedIn's OAuth tools.

  1. On the Auth tab, click OAuth 2.0 tools in the right-hand sidebar.
  2. Click Create token and select these scopes:
  3. openid
  4. profile
  5. w_member_social
  6. Check I understand this tool… and click Request access token. Log in when prompted.
  7. Copy the resulting access token, then run:

bash export ACCESS_TOKEN="paste-your-token-here" curl -X GET "https://api.linkedin.com/v2/userinfo" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "X-Restli-Protocol-Version: 2.0.0"

  1. The response will look like:

json { "name": "Jane Doe", "sub": "abcd1234", ... }

Your Person URN is urn:li:person: followed by the value of sub. In this example: urn:li:person:abcd1234.

Step 6: Add LinkedIn to POSSE Post

  1. Go to Add social account and select LinkedIn as the platform.
  2. Add each content type you want to crosspost from.
  3. In the LinkedIn credentials section, enter your Client ID and Person URN.
  4. Save the account.

Step 7: Authorize POSSE Post

  1. Go to Social Accounts in your Drupal admin.
  2. Find your LinkedIn account in the list. Click the Operations dropdown arrow and select Authorize.
  3. You will be redirected to LinkedIn to grant access. Log in and approve.
  4. On the confirmation page, copy the access token and add it to your .env file:

LINKEDIN_ACCESS_TOKEN=your_access_token_here

Your Person URN is saved to the account automatically.

Token expiration

LinkedIn access tokens expire periodically (typically every 60 days). POSSE Post tracks the expiration date automatically — it is shown in the Expires column on the Social Accounts list and on the account edit form. Editors will also see a warning in the POSSE Post panel when editing an unpublished node if a token has expired or is expiring within 14 days.

Renewing an expired token

LinkedIn tokens cannot be extended, so renew the token the same way whether it is about to expire or has already expired:

  1. Go to Social Accounts and click Operations → Authorize for the LinkedIn account.
  2. Complete the LinkedIn authorization flow.
  3. Replace LINKEDIN_ACCESS_TOKEN in your .env file or hosting environment with the new token shown on the confirmation page. Restart or redeploy so the new value reaches PHP (for example, ddev restart).
  4. Save the account — the new expiration date is fetched and stored automatically.
  5. On the Crossposts tab, click Publish now for any crossposts that failed while the token was expired.