Gathering detailed insights and metrics for passport-auth0-openidconnect
Gathering detailed insights and metrics for passport-auth0-openidconnect
Gathering detailed insights and metrics for passport-auth0-openidconnect
Gathering detailed insights and metrics for passport-auth0-openidconnect
Passport strategy for authenticating with Auth0 using OpenID Connect.
npm install passport-auth0-openidconnect
Typescript
Module System
Node Version
NPM Version
59.8
Supply Chain
89.8
Quality
74.8
Maintenance
50
Vulnerability
97.9
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
5 Stars
20 Commits
7 Forks
106 Watchers
7 Branches
40 Contributors
Updated on May 06, 2025
Latest Version
0.2.0
Package Id
passport-auth0-openidconnect@0.2.0
Unpacked Size
320.65 kB
Size
279.64 kB
File Count
21
NPM Version
4.6.1
Node Version
8.9.3
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
Passport strategy for authenticating with Auth0 using OpenID Connect.
This module lets you authenticate using Auth0 in your Node.js applications. By plugging into Passport, OpenID Connect authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.
This Auth0 OpenID Connect strategy is based on the passport-openidconnect strategy.
1npm install passport-auth0-openidconnect --save
Copy your credentials from your App's setting within the Auth0 Dashboard and initialize the strategy as follows:
1var passport = require('passport');
2var Strategy = require('passport-auth0-openidconnect').Strategy;
3
4passport.use(new Strategy({
5 domain: process.env.AUTH0_DOMAIN,
6 clientID: process.env.AUTH0_CLIENT_ID,
7 clientSecret: process.env.AUTH0_CLIENT_SECRET,
8 callbackURL: process.env.AUTH0_CALLBACK_URL
9 },
10 function(issuer, audience, profile, cb) {
11 //not interested in passport profile normalization,
12 //just the Auth0's original profile that is inside the _json field
13 return cb(null, profile._json);
14 }));
You can add more params to the callback in case you need to grab a refreshToken or id_token.
You can also use the passReqToCallback
option to make the request available in the callback function. This is useful if you need to access the session.
1passport.use(new Strategy({
2 domain: process.env.AUTH0_DOMAIN,
3 clientID: process.env.AUTH0_CLIENT_ID,
4 clientSecret: process.env.AUTH0_CLIENT_SECRET,
5 callbackURL: process.env.AUTH0_CALLBACK_URL,
6 passReqToCallback: true
7 },
8 function(req, issuer, audience, profile, accessToken, refreshToken, params, cb) {
9
10 console.log('issuer',issuer); // https://your-domain.auth0.com/
11 console.log('audience',audience); // user's id. i.e: auth0|5633afe0794d1c5a0b72a2be
12 console.log('accessToken',accessToken); // QSs...emeU
13 console.log('refreshToken',refreshToken); // gAUqAgTPr...dOquQxQ
14 console.log('params',params); // { access_token: 'QSs...meU',
15 // id_token: 'eyJ0eXAi...t7j-e_0',
16 // token_type: 'Bearer' }
17
18 //save parameters in session as needed
19 req.session.id_token = params.id_token;
20
21 //not interested in passport profile normalization,
22 //just the Auth0's original profile that is inside the _json field
23 return cb(null, profile._json);
24 }));
1 2// show the index page, which uses Lock to authenticate to Auth0 3app.get('/', function (req, res) { 4 res.render('index', env); 5}); 6 7//handle the login callback using auth0-oidc srategy 8app.get('/callback', 9 passport.authenticate('auth0-oidc'), function (req, res) { 10 res.redirect('/user'); 11 } 12); 13 14//user must be authenticated to access the user's page. 15app.get('/user', 16 require('connect-ensure-login').ensureLoggedIn('/'), 17 function(req, res){ 18 res.render('user', { user: req.user }); 19 });
You can find a complete example of a Node.js Regular Web App using the passport-auth0-oidc strategy in the examples/login folder.
Auth0 helps you to:
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 5/17 approved changesets -- score normalized to 2
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
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