Upload
kianosh-pourian
View
1.274
Download
3
Embed Size (px)
DESCRIPTION
Installation and configuration of Passport - an authentication and session management module for NodeJS.
Citation preview
Session Management & Authentication with Node
Kianosh Pouriantwitter: @kianoshp
blog: innovatorylife.com
Thursday, January 17, 13
Purpose• To be able to authenticate users through:
• login and password
• third party validation
• github
• Manage sessions
Thursday, January 17, 13
Options
• EveryAuth
• Passport
• Custom made
• connect-auth
Thursday, January 17, 13
Passport - installation & configuration
• Modules needed
• passport
• passport-local
• Configuration
• Authenticate
• Sessions
Thursday, January 17, 13
Pitfalls• req.flash - https://github.com/visionmedia/express/
wiki/Migrating-from-2.x-to-3.x
• connect-flash
• DB for session management
• Redis - http://stackoverflow.com/questions/12947965/nodejs-passport-js-redis-how-to-store-sessions-in-redis?lq=1
• MongoDB
Thursday, January 17, 13
Pitfalls (continued)• Order of configuration
• The order that you pass things to app.use determines the order in which each middleware is given the opportunity to process a request.
• place app.use(...static) at the top in order to avoid parsing and authenticating them through passport.
Thursday, January 17, 13