Gathering detailed insights and metrics for passport-auth0
Gathering detailed insights and metrics for passport-auth0
Gathering detailed insights and metrics for passport-auth0
Gathering detailed insights and metrics for passport-auth0
npm install passport-auth0
56
Supply Chain
97.8
Quality
82.5
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
296 Stars
233 Commits
92 Forks
122 Watching
9 Branches
63 Contributors
Updated on 04 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-21.5%
12,006
Compared to previous day
Last week
-8%
73,073
Compared to previous week
Last month
-3.2%
329,010
Compared to previous month
Last year
15%
3,677,668
Compared to previous year
3
The Auth0 authentication strategy for Passport.js, an authentication middleware for Node.js that can be unobtrusively dropped into any Express-based web application.
:books: Documentation - :rocket: Getting Started - :speech_balloon: Feedback
:information_source: Maintenance Advisory: With the release of https://github.com/auth0/express-openid-connect, we will no longer be adding new features to this library, however we will continue to maintain this library and fix issues. You can read more about the release of our new library at https://auth0.com/blog/auth0-s-express-openid-connect-sdk/
The Auth0 Passport strategy is installed with npm.
npm install passport-auth0
The Auth0 Passport strategy enforces the use of the state
parameter in OAuth 2.0 authorization requests and requires session support in Express to be enabled.
If you require the state
parameter to be omitted (which is not recommended), you can suppress it when calling the Auth0 Passport strategy constructor:
1const Auth0Strategy = require('passport-auth0');
2const strategy = new Auth0Strategy({
3 // ...
4 state: false
5 },
6 function(accessToken, refreshToken, extraParams, profile, done) {
7 // ...
8 }
9);
If you want to change the scope of the ID token provided, add a scope
property to the authenticate configuration passed when defining the route. These must be OIDC standard scopes. If you need data outside of the standard scopes, you can add custom claims to the token.
1app.get( 2 '/login', 3 passport.authenticate('auth0', {scope: 'openid email profile'}), 4 function (req, res) { 5 res.redirect('/'); 6 } 7);
If you want to force a specific identity provider you can use:
1app.get( 2 '/login/google', 3 passport.authenticate('auth0', {connection: 'google-oauth2'}), 4 function (req, res) { 5 res.redirect('/'); 6 } 7);
If you force an identity provider you can also request custom scope from that identity provider:
1app.get( 2 '/login/google', 3 passport.authenticate('auth0', { 4 connection: 'google-oauth2', 5 connection_scope: 'https://www.googleapis.com/auth/analytics, https://www.googleapis.com/auth/contacts.readonly' 6 }), 7 function (req, res) { 8 res.redirect('/'); 9 } 10);
If you want to specify an audience for the returned access_token
you can:
1app.get( 2 '/login', 3 passport.authenticate('auth0', {audience: 'urn:my-api'}), 4 function (req, res) { 5 res.redirect('/'); 6 } 7);
If you want to check authentication without showing a prompt:
1app.get( 2 '/login', 3 passport.authenticate('auth0', {prompt: 'none'}), 4 function (req, res) { 5 res.redirect('/'); 6 } 7);
We appreciate feedback and contribution to this repo! Before you get started, please see the following:
To provide feedback or report a bug, please raise an issue on our issue tracker.
Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout Why Auth0?
This project is licensed under the MIT license. See the LICENSE file for more info.
No vulnerabilities found.
Reason
all changesets reviewed
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
0 existing vulnerabilities detected
Reason
SAST tool detected
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
1 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
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Score
Last Scanned on 2024-11-25
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