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.
Per the LinkedIn docs:
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.