passport-nus

NUSNET authentication strategy for Passport.

npm install passport-nus
4 downloads in the last week
8 downloads in the last month

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](http://fazli.sapuan.org), passport-ldap Copyright (c) 2011-2013 Paul Dixon [http://www.mintbridge.co.uk/](http://www.mintbridge.co.uk)

npm loves you