All Projects â†’ auth0 â†’ Passport Auth0

auth0 / Passport Auth0

Licence: mit
Auth0 authentication strategy for Passport.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Passport Auth0

teanjs
đŸ”Ĩ TypeORM - Express - Angular 8 - NestJS Server Side Rendering (SSR) đŸ˜ē
Stars: ✭ 62 (-75.78%)
Mutual labels:  passport
react-isomorphic-bundle
React Redux Universal (isomorphic) bundle
Stars: ✭ 53 (-79.3%)
Mutual labels:  passport
spid-passport
Passport authentication provider for SPID
Stars: ✭ 17 (-93.36%)
Mutual labels:  passport
passport-line-auth
Line authentication strategy for Passport and Node.js.
Stars: ✭ 31 (-87.89%)
Mutual labels:  passport
node-express-mongo-passport-jwt-typescript
A Node.js back end web application with REST API, user JWT authentication and MongoDB data storage using TypeScript
Stars: ✭ 51 (-80.08%)
Mutual labels:  passport
chat-app
An Express React Redux Socket.IO Chat App that uses MongoDB with Mongoose driver as database and Passport for user authentication.
Stars: ✭ 24 (-90.62%)
Mutual labels:  passport
Laravel-Ecommerce-API
Lite E-Commerce API
Stars: ✭ 32 (-87.5%)
Mutual labels:  passport
nestjs-auth0
Nestjs + Auth0
Stars: ✭ 80 (-68.75%)
Mutual labels:  passport
TogetherStream
A social and synchronized streaming experience
Stars: ✭ 16 (-93.75%)
Mutual labels:  passport
http-auth
Node.js package for HTTP basic and digest access authentication.
Stars: ✭ 364 (+42.19%)
Mutual labels:  passport
Clean-Laravel-Api
⭐ī¸ Build APIs You Won't Hate In Laravel.
Stars: ✭ 85 (-66.8%)
Mutual labels:  passport
laravel8-passport-fcm-api
Live streaming gigs mobile app RESTful API endpoints
Stars: ✭ 13 (-94.92%)
Mutual labels:  passport
nestjs-auth0
An example NestJS application that uses Auth0 via Passport for authentication.
Stars: ✭ 148 (-42.19%)
Mutual labels:  passport
system information school
Build website using laravel as backend, vue js as front end and full request using api with middleware api passport.
Stars: ✭ 17 (-93.36%)
Mutual labels:  passport
nestjs-auth-starter-kit
NestJS Auth Starter Kit (typescript / typeorm / swagger / passport / bcrypt)
Stars: ✭ 37 (-85.55%)
Mutual labels:  passport
yelp-camp
A Node.js web application project from the Udemy course - The Web Developer Bootcamp by Colt Steele
Stars: ✭ 36 (-85.94%)
Mutual labels:  passport
chai-passport-strategy
Helpers for testing Passport strategies with the Chai assertion library.
Stars: ✭ 32 (-87.5%)
Mutual labels:  passport
react-redux-jwt-authentication-boilerplate
React-Redux JWT Authentication Boilerplate
Stars: ✭ 44 (-82.81%)
Mutual labels:  passport
nest-js-boilerplate
Nest.js boilerplate
Stars: ✭ 79 (-69.14%)
Mutual labels:  passport
node-facebook-twitter-google-github-login
Node, Express, Mongoose, Passport, Facebook, Twitter, Google and Github Authentication (Login)
Stars: ✭ 31 (-87.89%)
Mutual labels:  passport

passport-auth0

ℹī¸ 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/

This is the Auth0 authentication strategy for Passport.js. Passport is authentication middleware for Node.js that can be unobtrusively dropped into any Express-based web application.

For Management API endpoints, please see the Node Auth0 SDK.

Build Status npm npm License FOSSA Status

Table of Contents

Documentation

Full documentation with examples can be found in the Node.js Quickstart.

You can also see fully working demos using this library in our Auth0 blog:

Installation

The Auth0 Passport strategy is installed with npm.

npm install passport-auth0

Customization

State parameter

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:

const Auth0Strategy = require('passport-auth0');
const strategy = new Auth0Strategy({
     // ...
     state: false
  },
  function(accessToken, refreshToken, extraParams, profile, done) {
    // ...
  }
);

More on state handling here.

Scopes

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.

app.get(
	'/login',
	passport.authenticate('auth0', {scope: 'openid email profile'}), 
	function (req, res) {
		res.redirect('/');
	}
);

Force a Specific IdP

If you want to force a specific identity provider you can use:

app.get(
	'/login/google',
	passport.authenticate('auth0', {connection: 'google-oauth2'}), 
	function (req, res) {
		res.redirect('/');
	}
);

If you force an identity provider you can also request custom scope from that identity provider:

app.get(
	'/login/google', 
	passport.authenticate('auth0', {
		connection: 'google-oauth2',
		connection_scope: 'https://www.googleapis.com/auth/analytics, https://www.googleapis.com/auth/contacts.readonly'
	}), 
	function (req, res) {
		res.redirect('/');
	}
);

Getting Access Tokens

If you want to specify an audience for the returned access_token you can:

app.get(
	'/login',
	passport.authenticate('auth0', {audience: 'urn:my-api'}), 
	function (req, res) {
	  res.redirect('/');
	}
);

Silent Authentication

If you want to check authentication without showing a prompt:

app.get(
	'/login',
	passport.authenticate('auth0', {prompt: 'none'}), 
	function (req, res) {
		res.redirect('/');
	}
);

Support + Feedback

  • Use Issues for code-level support
  • Use our Community for usage, questions, specific cases

Vulnerability Reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

What is Auth0?

Auth0 helps you to easily:

  • implement authentication with multiple identity providers, including social (e.g., Google, Facebook, Microsoft, LinkedIn, GitHub, Twitter, etc), or enterprise (e.g., Windows Azure AD, Google Apps, Active Directory, ADFS, SAML, etc.)
  • log in users with username/password databases, passwordless, or multi-factor authentication
  • link multiple user accounts together
  • generate signed JSON Web Tokens to authorize your API calls and flow the user identity securely
  • access demographics and analytics detailing how, when, and where users are logging in
  • enrich user profiles from other data sources using customizable JavaScript rules

Why Auth0?

License

This project is licensed under the MIT license. See the LICENSE file for more info.

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].