NUS authentication strategy for Passport and Node.js.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/passport-nus
.gitignore
.npmignore
LICENSE
README.md
package.json

README.md

Passport-NUS

Passport strategy for authenticating against NUS LDAP servers.

This module lets you authenticate against NUS LDAP servers in your Node.js applications. By plugging into Passport, NUSNET authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.

Install

$ npm install passport-nus

Usage

Configure Strategy

The NUS authentication strategy authenticates requests by delegating to the nus ldap servers using the openldap protocol.

The strategy requires a verify callback which accepts a user profile entry from the directory, and then calls the done callback supplying a user.

passport.use(new NusStrategy(
  function(profile, done) {
    return done(null, JSON.parse(profile));
  }
));

Authenticate Requests

Use passport.authenticate(), specifying the 'nus' strategy, to authenticate requests.

For example, as route middleware in an Express application:

app.post('/auth/nus',
  passport.authenticate('nus', {
    successRedirect: '/',
    failureRedirect: '/auth/login/'
  })
);

Credits

License

The MIT License

Copyright (c) 2013 Fazli Sapuan <http://fazli.sapuan.org>, passport-ldap Copyright (c) 2011-2013 Paul Dixon <http://www.mintbridge.co.uk/>