passport-linkedin-oauth2-token

0.0.4 • Public • Published

passport-linkedin-oauth2-token

npm package

Token strategy for LinkedIn OAuth2 that supports r_liteprofile and r_emailaddress scopes.

Install

$ npm i passport-linkedin-oauth2-token

Usage

var LinkedInTokenStrategy = require('passport-linkedin-oauth2-token').Strategy;
var passport = require('passport');
 
passport.use(
  new LinkedInTokenStrategy(
    {
      clientID: '<client id>',
      clientSecret: '<client secret>',
      scope: ['r_liteprofile', 'r_emailaddress'],
      
      // optionally pass req to callback
      passReqToCallback: true
    },
    function (req, accessToken, refreshToken, profile, done) {
      // asynchronous verification, for effect...
      process.nextTick(function () {
        // To keep the example simple, the user's LinkedIn profile is returned to
        // represent the logged-in user. In a typical application, you would want
        // to associate the LinkedIn account with a user record in your database,
        // and return that user instead.
        return done(null, profile);
      });
    }
  )
);

Package Sidebar

Install

npm i passport-linkedin-oauth2-token

Weekly Downloads

46

Version

0.0.4

License

MIT

Unpacked Size

8.02 kB

Total Files

5

Last publish

Collaborators

  • onwd