ArkeologeN / node-linkedin

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

Allow users to specify what version oauth token they are using #29

Closed foxdavidj closed 9 years ago

foxdavidj commented 9 years ago

This fix allows usage of OAuth v1.0 tokens with LinkedIn. This is important as many libraries (including LinkedIn's own JSSDK) create 1.0 tokens.

The changes are backwards compatible. The new functionality works as follows:

Use an OAuth v1 token:

var linkedin = LinkedIn.init(
    {token: access_token, version: 1},
    {timeout: 5000}
);

Use an OAuth v2 token:

var linkedin = LinkedIn.init(access_token, {timeout: 5000});