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
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));
}
));
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/'
})
);
- Fazli Sapuan
- Based on passport-ldap by Paul Dixon
Copyright (c) 2013 Fazli Sapuan <http://fazli.sapuan.org>, passport-ldap Copyright (c) 2011-2013 Paul Dixon <http://www.mintbridge.co.uk/>