Skip to content
Passport-based User Authentication system for sails.js applications. Designed to work well with the sails-permissions module.
Branch: master
Clone or download
Latest commit 21ba16f Oct 3, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api fix sails-auth for sails 0.12.5 Sep 27, 2016
assets/js/dependencies Added unit tests socket.io for sails-auth, implemented @scott-wyatt f… Apr 30, 2015
config Add new Delegated Authentication Protocol Aug 8, 2016
lib/error Use waterline-style validation errors with filtered information Jun 6, 2015
test Change suggested by @tjwebb Mar 28, 2016
.babelrc fix sails-auth for sails 0.12.5 Sep 27, 2016
.gitignore Update User, and password if set. Mar 11, 2016
.npmignore add npmignore Aug 21, 2015
.sailsrc
.travis.yml [ci] update npm key Sep 2, 2016
LICENSE update license Aug 23, 2015
README.md Update README.md Oct 3, 2016
gulpfile.js
package.json fix dev dependencies Sep 27, 2016

README.md

sails-auth

Looking for maintainers

NPM version Build status Dependency Status

Passport-based User Authentication system for Sails.js applications.

1. Install

$ npm install sails-auth --save

This will install sails-auth as a Sails Hook. The Hook uses marlinspike to inject the relevant Controllers, Policies, etc into your Sails application.

2. Configure

config/passport.js

By default, the local and basic strategies are enabled. See config/passport.js for examples of how to add and configure additional authentication strategies.

config/auth.js

  bcrypt: {
    /**
     * Specifiy number of salt rounds to perform on password. Values >10 are
     * slow.
     */
    rounds: 8
  }

3. Authenticate!

Create users as you normally would (POST to /user). Authenticate using the endpoint of the provider you've chosen.

Local

Authenticate with the local strategy via a POST to /auth/local with params identifier (email) and password). This will also create a session. See passport.local for more.

HTTP Basic and Digest

See passport.http.

Additional Passport Strategies

/user/me

Returns User for this authenticated session.

Permissions

For comprehensive user account control with role-based permissioning, object ownership, and row-level security, see sails-permissions, which uses this project as a dependency.

License

MIT

Maintained By

You can’t perform that action at this time.