Passport Auth0 OpenID Connect
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.
Installation
npm install passport-auth0-openidconnect --save
Configuration
Copy your credentials from your App's setting within the Auth0 Dashboard and initialize the strategy as follows:
var passport = ;var Strategy = Strategy; passport;
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.
passport;
Usage
// show the index page, which uses Lock to authenticate to Auth0app; //handle the login callback using auth0-oidc srategyapp; //user must be authenticated to access the user's page.app;
Example
You can find a complete example of a Node.js Regular Web App using the passport-auth0-oidc strategy in the examples/login folder.
What is Auth0?
Auth0 helps you to:
- Add authentication with multiple authentication sources, either social like Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, amont others, or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider.
- Add authentication through more traditional username/password databases.
- Add support for linking different user accounts with the same user.
- Support for generating signed Json Web Tokens to call your APIs and flow the user identity securely.
- Analytics of how, when and where users are logging in.
- Pull data from other sources and add it to the user profile, through JavaScript rules.
Create a free Auth0 Account
- Go to Auth0 and click Sign Up.
- Use Google, GitHub or Microsoft Account to login.
Issue Reporting
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.
Author
License
This project is licensed under the MIT license. See the LICENSE file for more info.