Search code examples
iosoauthoauth-2.0linkedin-api

How to convert LinkedIn API for sharing the content from OAuth 1.2 to OAuth2


I'm working on building an app for our project.

I have to share content in our app to linkedIn account from the app.

Before we used to OAuth1 of linkedIn Developers API and it was working fine., but now it is not working.

I made some changes like changing the permissions from rw_nus to w_share., with this change I'm able to see the login page of the Linkedin in our app., but after successfully adding the account, now I'm unable to share the content on LinkedIn.

I'm getting the following error :

401, Unauthorized error.

The path I'm using for shares is :

http://api.linkedin.com/v1/people/~/shares

What other changes do I need to do to make it work?


Solution

  • Have you updated your registered app at https://developer.linkedin.com/ to work with the new OAuth 2.0?

    More information on the new share api can be found here: https://developer.linkedin.com/docs/share-on-linkedin

    FYI: The old Api key is now called "Client Id". Confused me for ages after the upgrade and some of the api docs still reference api key.