I am using Sails v0.10.5. I want to integrate an authentication system with username and password using Passport. For that I was going through the following documentations:
But, I have seen in the comments that these are outdated and no longer works with sails v0.10.5. I tried these, it was not authenticating and I was able to access all the controller actions without any authentication.
Is there any updated version or any other useful documentation for integrating?
I strongly advise you to try sails-generate-auth generator. It is based on passport and it creates whole authentication layer for your sails.js application including local policy (user/password), OAuth2.0 and OpenID.
Sails-generate-auth will create for you two new models (User, Passport), authentication controller, service, configure routes and policies. So if you want to apply authentication to your existing application it would be safer to create fresh sails application, generate authentication layer using sails-generate-auth, test it a little bit and then copy necessary files to your original application.
Hope that helps.
Edit
sails-auth is also a good solution. Similarily to sails-generate-auth, it generates all necessary models and services so you can connect it easily to your existing service.
Check out this easy to use example for sails.js with passport.js supporting both Email, Twitter and Facebook: https://github.com/bmustata/sails-auth-super-template
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With