Skip to content

risman94/auth-passport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

authentication with passport

documentation : passportjs

passport strategies :

  • passport-local
  • passport-facebook
  • passport-google-oauth

install

npm install

add file config/config.json for connect database

{
	"test": {
		"PORT": "your-port",
		"MONGODB_URI": "mongodb://localhost/'your-database'"
	}
}

add file config/auth.js

module.exports = {
    'facebookAuth' : {
        'clientID'      : '...', // your App ID
        'clientSecret'  : '...', // your App Secret
        'callbackURL'   : 'http://localhost:"your-port"/auth/facebook/callback'
    },
    'googleAuth' : {
        'clientID'      : '...', // your App ID
        'clientSecret'  : '...', // your App Secret
        'callbackURL'   : 'http://localhost:"your-port"/auth/google/callback'
    }
};

and run npm

npm start