- Go to https://developer.linkedin.com/
- Sign in with your LinkedIn account
- Navigate to My Apps → Create App
- Fill in:
- App name: InPost (or your preferred name)
- LinkedIn Page: Associate with your LinkedIn Page (you can create a test page if needed)
- Privacy policy URL: Can use your website or a placeholder for testing
- App logo: Optional
- Click Create app
In your app dashboard, go to the Products tab and request:
- Share on LinkedIn — grants
w_member_socialscope (required for posting) - Sign In with LinkedIn using OpenID Connect — grants
openidandemailscopes
Approval for "Share on LinkedIn" may require review. For personal/testing use, it is usually approved quickly.
- Go to the Auth tab in your app settings
- Under OAuth 2.0 settings, add this redirect URL:
http://localhost:3456/callback - Copy your Client ID and Client Secret
- Add them to your
.envfile:LINKEDIN_CLIENT_ID=your_client_id LINKEDIN_CLIENT_SECRET=your_client_secret
Run the auth command:
inpost auth linkedinThis will:
- Start a local server on port 3456
- Open your browser to LinkedIn's authorization page
- After you grant access, exchange the code for an access token
- Store credentials securely in
~/.inpost/credentials.json - Automatically update the
LINKEDIN_CREDENTIALSGitHub Actions secret (requiresghCLI to be installed and authenticated)
- LinkedIn access tokens expire after 60 days
- InPost stores the expiry date and warns you via
inpost status - When the token expires, re-run
inpost auth linkedin - Standard LinkedIn apps do not support automatic token refresh
# Check authentication status
inpost status
# Test with a dry run (does not actually post)
inpost publish "Hello from InPost!" --dry-run| Scope | Purpose | Granted By |
|---|---|---|
w_member_social |
Create posts on behalf of the member | Share on LinkedIn product |
openid |
OpenID Connect authentication | Sign In with LinkedIn product |
email |
Read member email address | Sign In with LinkedIn product |
"Application not authorized" error
- Ensure "Share on LinkedIn" product is approved in your app's Products tab
- Check that
w_member_socialscope appears in your app's Auth tab
"Invalid redirect URI" error
- Verify
http://localhost:3456/callbackis listed in your app's redirect URLs - The URL must match exactly (including port and path)
Token expired
- Run
inpost auth linkedinagain to get a new token - Tokens last 60 days from issuance