Monday 26 March 2018

Anatomy of a Passport enabled Express App?

I can't seem to find a clear, concise tutorial on what is required to implement passport in Express Applications. I mean, I know that I need to include passport and the strategy I will use, but there's no high level overview of things to do with passport.I guess the questions lingering in my mind are:where do we put the Passport.use statements so that express will know that passport is being used? right in the middleware stack? (Ex: app.use(passport());??)what routes should be available for the purpose of sign-in/Registration? (Ex. GET/POST for /register, /login)What steps should be taken in these routes?(ex. check for user in DB, compare password, re-route to protected route after authentication, etc....)What should the app be doing during an authentication enabled route? (so I can understand what my app is doing during the process, for debugging purposes.)Not sure I've asked everything, and I'm sure I'm not the only one that has these types of questions. I can understand that no one really has this completely figured out, but something as popular as Passport should be documented, regardless of whether it's officially marked down.There has to be an explanation somewhere. Resources for answering the questions are good too.

Submitted March 26, 2018 at 06:50PM by cjrutherford

No comments:

Post a Comment