SlideShare a Scribd company logo
1 of 6
Download to read offline
Session Management &
                     Authentication with Node
                               Kianosh Pourian
                             twitter: @kianoshp
                           blog: innovatorylife.com




Thursday, January 17, 13
Purpose
                     •     To be able to authenticate users through:

                           •   login and password

                           •   third party validation

                               •   twitter

                               •   facebook

                               •   linkedin

                               •   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

More Related Content

More from Kianosh Pourian

Why are preprocessors divisive
Why are preprocessors divisiveWhy are preprocessors divisive
Why are preprocessors divisive
Kianosh Pourian
 

More from Kianosh Pourian (7)

Unbloat your SDLC
Unbloat your SDLCUnbloat your SDLC
Unbloat your SDLC
 
Would you like some Grids with that?
Would you like some Grids with that?Would you like some Grids with that?
Would you like some Grids with that?
 
Introvert & extrovert: The melting pot of development
Introvert & extrovert: The melting pot of developmentIntrovert & extrovert: The melting pot of development
Introvert & extrovert: The melting pot of development
 
Why are preprocessors divisive
Why are preprocessors divisiveWhy are preprocessors divisive
Why are preprocessors divisive
 
Intro to KnockoutJS
Intro to KnockoutJSIntro to KnockoutJS
Intro to KnockoutJS
 
Intro to SASS CSS
Intro to SASS CSSIntro to SASS CSS
Intro to SASS CSS
 
Advanced sass
Advanced sassAdvanced sass
Advanced sass
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Passport Nodejs Lightening Talk

  • 1. Session Management & Authentication with Node Kianosh Pourian twitter: @kianoshp blog: innovatorylife.com Thursday, January 17, 13
  • 2. Purpose • To be able to authenticate users through: • login and password • third party validation • twitter • facebook • linkedin • github • Manage sessions Thursday, January 17, 13
  • 3. Options • EveryAuth • Passport • Custom made • connect-auth Thursday, January 17, 13
  • 4. Passport - installation & configuration • Modules needed • passport • passport-local • Configuration • Authenticate • Sessions Thursday, January 17, 13
  • 5. 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
  • 6. 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