Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #254 from feathersjs/auth0
Browse files Browse the repository at this point in the history
Add Auth0 to OAuth providers
  • Loading branch information
marshallswain authored Jul 31, 2017
2 parents 6464c98 + 6dbd149 commit 73fdc9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions generators/authentication/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const crypto = require('crypto');

const Generator = require('../../lib/generator');
const OAUTH2_STRATEGY_MAPPINGS = {
auth0: 'passport-auth0',
google: 'passport-google-oauth20',
facebook: 'passport-facebook',
github: 'passport-github'
Expand All @@ -22,6 +23,9 @@ module.exports = class AuthGenerator extends Generator {
name: 'Username + Password (Local)',
value: 'local',
checked: true
}, {
name: 'Auth0',
value: 'auth0'
}, {
name: 'Google',
value: 'google'
Expand Down Expand Up @@ -101,6 +105,10 @@ module.exports = class AuthGenerator extends Generator {
};
includesOAuth = true;

if(strategy === 'auth0') {
strategyConfig.domain = 'mydomain.auth0.com';
}

if (strategy === 'facebook') {
strategyConfig.scope = ['public_profile', 'email'];
strategyConfig.profileFields = ['id', 'displayName', 'first_name', 'last_name', 'email', 'gender', 'profileUrl', 'birthday', 'picture', 'permissions'];
Expand Down

0 comments on commit 73fdc9f

Please sign in to comment.