This is the tutorial I wish I had for integrating Passport.js with Sails.js. When creating web applications, you'd love to have a user sign-in and sign-out function, while limiting access to certain functions if the visitor is merely a guest.

Enter Passport.js. This fantastic piece of unobtrusive Express middleware provides many mechanisms of authorization, including the usual username/password, or even social media such as Twitter and Facebook.

Sails.js is based off Express, so we'd expect Passport.js to slide in nicely, and it certainly does. Without further ado, let's get to making an application!


Via Jan Hesse