Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: LinkedIn - move to v2 API calls, drop the advertising API requirement #463

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jamesread
Copy link
Collaborator

@jamesread jamesread commented Dec 2, 2024

The LinkedIn Advertising API requirement is challenging, because it requires manual review and approval of the app by LinkedIn.

The only reason for the LinkedIn Advertising API is to be able to read r_basicprofile - which is typically used to view other people's profiles. Postiz only needs to view the currently logged in user, and accessing /v2/userinfo is a better way of doing this, ad /v2/me is a legacy API call.

This change removes the calls to /v2/me, and just uses the /v2/userinfo call, which means we can drop the LinkedIn Advertising API requirement - making it much easier for users to add LinkedIn support in postiz (including me!).

I have tested this on my own LinkedIn account, and posting is working just fine.

I see that there is a company() function, but I don't see this actually being used at the moment.

I originally raised #428 to discuss this, but I think a PR would be easier to discuss.

Copy link

vercel bot commented Dec 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
gitroom ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 9:25pm
postiz ⬜️ Ignored (Inspect) Visit Preview Dec 2, 2024 9:25pm

@nevo-david
Copy link
Contributor

The main problem I have seen is that without the advertising API, you don't get the refresh token, is it working without in v2?

@jamesread
Copy link
Collaborator Author

It looks like you're right; https://learn.microsoft.com/en-us/linkedin/shared/authentication/programmatic-refresh-tokens

Do you mind if I add the extra scope behind a LINKEDIN_SKIP_ADVERTISING_API env (default to not skipping if this isn't set - eg don't break platform.postiz.com).

Copy link

@A1exKH A1exKH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesread this PR LGTM.

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.

3 participants