Skip to content

Conversation

@dredozubov
Copy link

What kind of change does this PR introduce?

Bug fix

Why was this change needed?

Self-hosted Postiz users cannot connect their personal LinkedIn profiles because the OAuth flow requests organization scopes (w_organization_social, rw_organization_admin, r_organization_social) that individual developers cannot obtain from LinkedIn.

LinkedIn's OAuth rejects the entire request if any scope is unauthorized. Since organization scopes require Advertising API or Community Management API access (which requires legal entity verification), individual developers are completely blocked—even though w_member_social alone is sufficient for personal profile posting.

Related issue: Fixes #844

Solution

Decouple the OAuth scopes between the two LinkedIn providers:

Integration Scopes Works Without Org API Access
LinkedIn (personal) openid, profile, w_member_social ✅ Yes
LinkedIn Page (org) All 7 scopes including org scopes ❌ No (as expected)

Changes

  • linkedin.provider.ts: Reduced scopes to personal-only (openid, profile, w_member_social)
  • linkedin.page.provider.ts: Unchanged (already overrides with full org scopes) + added documentation comment

The fix works because LinkedinPageProvider extends LinkedinProvider and explicitly overrides the scopes property, so the parent's reduced scopes don't affect organization page functionality.

Other information:

This issue has been reported by multiple users in #844 with various workarounds suggested, but no permanent fix was implemented. The change is minimal (net -2 lines of code) and follows the existing inheritance pattern in the codebase.

Verified that pnpm run build passes successfully.

Checklist:

  • I have read the CONTRIBUTING guide.
  • I checked that there were not similar issues or PRs already open for this.
  • This PR fixes just ONE issue (do not include multiple issues or types of change in the same PR)

…n scopes

Personal LinkedIn integration was blocked for self-hosters because OAuth
requested organization scopes (w_organization_social, etc.) that require
special LinkedIn API access. LinkedIn rejects the entire OAuth request if
any scope is unauthorized.

- Reduce LinkedinProvider scopes to personal-only: openid, profile, w_member_social
- LinkedinPageProvider retains full org scopes via override
- Add documentation comments explaining the scope separation

Fixes gitroomhq#844
@vercel
Copy link

vercel bot commented Dec 24, 2025

@dredozubov is attempting to deploy a commit to the Listinai Team on Vercel.

A member of the Team first needs to authorize it.

@dredozubov
Copy link
Author

Tested this fix in combination with #1136 (bearer token fix for profile picture download) using a deployment branch on my fork that combines both PRs.

Successfully added LinkedIn Channel to self-hosted Postiz instance. Both fixes work correctly together.

Features:
- JWT-based authentication using Ghost Admin API keys
- Post creation with HTML content support
- Featured image upload
- Tags support
- Custom post status (published/draft/scheduled)
- Custom slug support

Files added:
- ghost.provider.ts: Main provider implementation
- ghost.dto.ts: Post settings validation
- ghost.png: Platform icon (50x50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Individual Linkedin integration not working

1 participant