O'Reilly logo

Building Scalable Apps with Redis and Node.js by Joshua Johanan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding secure local authentication

We have Facebook and Google authentication working perfectly. We should be able to sign in and go to http://localhost:3000/chat and get an authorized Socket.IO handshake, although we now cannot sign in using our local username and password.

Note

Technically, the function does come back as authorized, but we do not set the correct variables in the session anymore.

We also want to create a function that is much more secure than just a username check.

The passport-local module will work in the passport.authenticate middleware, but we will have to write our own logic. This is different than the other modules where the logic is written, and we just have to add our application specific parts. Let's build our authentication ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required