vesse/passport-ldapauth — pull request #13 by addnab (2014-07-09 12:57:40+00:00)
Title: Multiple LDAP Server Configuration Support

This is to help with scenarios where you'd want the user who is getting authenticated to decide which LDAP Server they'd like to authenticate with.

The Multiple LDAP Server configurations can be stored in a Database and the required configuration to authenticate with can be fetched based on the user's request.

```
var getLDAPConfiguration = function(req, callback) {
//Fetch the required configuration from DB
var opts = fetchConfigFromDB(req.body.ldapServerId);
callback(null, opts);
});
};

var LdapStrategy = require('passport-ldapauth').Strategy;

passport.use(new LdapStrategy(getLDAPConfiguration,
function(user, done) {
...
return done(null, user);
}
));
```