- In this post we'll add social authentication - Facebook, Twitter, Github, Google, and Instagram - to Node.js.
- View the blog post here: http://mherman.org/blog/2013/11/10/social-authentication-with-passport-dot-js/
Updated on November 27th, 2015 - Refactored and added Instagram Authentication
- Clone
npm install
- Add oauth.js file to the root and add the social IDs and keys:
var ids = {
facebook: {
clientID: 'get_your_own',
clientSecret: 'get_your_own',
callbackURL: 'http://127.0.0.1:1337/auth/facebook/callback'
},
twitter: {
consumerKey: 'get_your_own',
consumerSecret: 'get_your_own',
callbackURL: 'http://127.0.0.1:1337/auth/twitter/callback'
},
github: {
clientID: 'get_your_own',
clientSecret: 'get_your_own',
callbackURL: 'http://127.0.0.1:1337/auth/github/callback'
},
google: {
clientID: 'get_your_own',
clientSecret: 'get_your_own',
callbackURL: 'http://127.0.0.1:1337/auth/google/callback'
},
instagram: {
clientID: 'get_your_own',
clientSecret: 'get_your_own',
callbackURL: 'http://127.0.0.1:1337/auth/instagram/callback'
}
};
module.exports = ids;
- Run
node app.js