NUSNET authentication strategy for Passport.

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


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.


$ npm install passport-nus


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:'/auth/nus',
  passport.authenticate('nus', {
    successRedirect: '/',
    failureRedirect: '/auth/login/'



The MIT License

Copyright (c) 2013 Fazli Sapuan [](, passport-ldap Copyright (c) 2011-2013 Paul Dixon [](

npm loves you