Gathering detailed insights and metrics for passport-linkedin-oauth2
Gathering detailed insights and metrics for passport-linkedin-oauth2
Gathering detailed insights and metrics for passport-linkedin-oauth2
Gathering detailed insights and metrics for passport-linkedin-oauth2
@types/passport-linkedin-oauth2
TypeScript definitions for passport-linkedin-oauth2
passport-linkedin-token-oauth2
LinkedIn token authentication strategy for Passport.
@dmapper/passport-linkedin-oauth2
Passport for LinkedIn OAuth2 API v2
passport-linkedin-oauth2-token
[](https://npmjs.org/package/passport-linkedin-oauth2-token)
npm install passport-linkedin-oauth2
Typescript
Module System
Node Version
NPM Version
JavaScript (92.66%)
EJS (7.34%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
122 Stars
77 Commits
109 Forks
16 Watchers
3 Branches
20 Contributors
Updated on Jun 21, 2025
Latest Version
2.0.0
Package Id
passport-linkedin-oauth2@2.0.0
Unpacked Size
25.71 kB
Size
7.08 kB
File Count
13
NPM Version
6.4.1
Node Version
8.14.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A simple Passport strategy for LinkedIn OAuth2 that works with lite profile.
npm install passport-linkedin-oauth2
Register the strategy
1var LinkedInStrategy = require('passport-linkedin-oauth2').Strategy; 2 3passport.use(new LinkedInStrategy({ 4 clientID: LINKEDIN_KEY, 5 clientSecret: LINKEDIN_SECRET, 6 callbackURL: "http://127.0.0.1:3000/auth/linkedin/callback", 7 scope: ['r_emailaddress', 'r_liteprofile'], 8}, function(accessToken, refreshToken, profile, done) { 9 // asynchronous verification, for effect... 10 process.nextTick(function () { 11 // To keep the example simple, the user's LinkedIn profile is returned to 12 // represent the logged-in user. In a typical application, you would want 13 // to associate the LinkedIn account with a user record in your database, 14 // and return that user instead. 15 return done(null, profile); 16 }); 17}));
and then authenticate as:
1app.get('/auth/linkedin', 2 passport.authenticate('linkedin', { state: 'SOME STATE' }), 3 function(req, res){ 4 // The request will be redirected to LinkedIn for authentication, so this 5 // function will not be called. 6 });
the login callback:
1app.get('/auth/linkedin/callback', passport.authenticate('linkedin', { 2 successRedirect: '/', 3 failureRedirect: '/login' 4}));
See this for details on LinkedIn API.
state
paramThe state
param is used to prevent CSRF attacks, and is required by the LinkedIn API. You can ask Passport to handle the sending and validating of the state
parameter by passing state: true
as an option to the strategy:
1var LinkedInStrategy = require('passport-linkedin-oauth2').Strategy; 2 3passport.use(new LinkedInStrategy({ 4 clientID: LINKEDIN_KEY, 5 clientSecret: LINKEDIN_SECRET, 6 callbackURL: "http://127.0.0.1:3000/auth/linkedin/callback", 7 scope: ['r_emailaddress', 'r_liteprofile'], 8 state: true 9}, function(accessToken, refreshToken, profile, done) { 10 // asynchronous verification, for effect... 11 process.nextTick(function () { 12 // To keep the example simple, the user's LinkedIn profile is returned to 13 // represent the logged-in user. In a typical application, you would want 14 // to associate the LinkedIn account with a user record in your database, 15 // and return that user instead. 16 return done(null, profile); 17 }); 18}));
and then authenticate as:
1app.get('/auth/linkedin', 2 passport.authenticate('linkedin'), 3 function(req, res){ 4 // The request will be redirected to LinkedIn for authentication, so this 5 // function will not be called. 6 });
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
This project is licensed under the MIT license. See the LICENSE file for more info.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
Found 6/11 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More