Using the OAuth.io JS library to get a personal feed from LinkedIn gives a 403 Forbidden Error

242 Views Asked by At

I'm using OAuth.io to authenticate and get the feeds of a number of services, most are working well but I'm having problems with the LinkedIn feed.

I have the service's oauth tokens stored server side so I create the OAuth object with the prior authenticated tokens and call the feed url from there:

  tokens = { oauth_token: 'abcd', oauth_token_secret: 'efgh' }
  serviceRequestor = OAuth.create('linkedin', tokens)

  if(serviceRequestor){
    serviceRequestor.get('/v1/people/~/network/updates')
  }

Running the above code gives me a 403 Forbidden response from LinkedIn. However if I run:

if(serviceRequestor){
  serviceRequestor.get('/v1/people/~')
}

I get a clean response with the appropriate details. I have all the permissions switched on in the LinkedIn App Settings to get the users feed etc.

Is there something I'm missing in my code or setup or is this something to do with OAuth.io or LinkedIn?

Thanks very much for your help in advance.

1

There are 1 best solutions below

1
On

The scope (permission) r_network has to be accepted by the user to access the endpoint /v1/people/~/network/updates. With Linkedin OAuth1 (provider linkedin in oauth.io), this permission can be configured in the Linkedin app settings. For Linkedin OAuth2 (provider linkedin2 in oauth.io), this permission can be added in your OAuth.io dashboard.