ArkeologeN / node-linkedin

LinkedIn 2.0 wrapper in Node.js
MIT License
163 stars 78 forks source link

Support using mobile access token #73

Closed soumak77 closed 7 years ago

soumak77 commented 7 years ago

Per the LinkedIn docs:

It is important to note that access tokens that are acquired via the Mobile SDK are only useable with the Mobile SDK, and cannot be used to make server-side REST API calls.

Similarly, access tokens that you already have stored from your users that authenticated using a server-side REST API call will not work with the Mobile SDK.

In researching this issue I have found suggestions that if you add the header x-li-src: msdk to the request, you can use a mobile access token on the server. Is there a built in way to pass headers to the requests being made by this library?

From what I can tell by reading the code, this is not supported. I'm thinking adding a new property to the init options such as, useMobileSdk, could be used to solve the problem. If that option is set, the header will be added to the request. If this approached is agreed upon I'll write up a PR.