Added credentialsLookup
Added option credentialsLookup
. It can be used to provide a synchronous function that receives req
object as argument and must return object with keys username
and password
(or name
and pass
as a courtesy to basic-auth
users) which will then be used for login.
Use for Basic Auth:
var basicAuth = require('basic-auth');
var ldapOpts = {
server: { },
credentialsLookup: basicAuth
}
Or eg. simpler body parsing when you know what you're handling:
var ldapOpts = {
server: { },
credentialsLookup: function(req) {
return {username: req.body.username, password: req.body.password};
}
}