Introduce ldap.useridField

Signed-off-by: Dustin Frisch <fooker@lab.sh>
This commit is contained in:
Dustin Frisch 2018-03-01 23:51:47 +01:00
parent b0ce3d0230
commit d6ee10d176
No known key found for this signature in database
GPG key ID: B4C3BF012D9B26BE
5 changed files with 10 additions and 3 deletions

View file

@ -24,8 +24,11 @@ passport.use(new LDAPStrategy({
}
}, function (user, done) {
var uuid = user.uidNumber || user.uid || user.sAMAccountName
var username = uuid
if (config.ldap.useridField && user[config.ldap.useridField]) {
uuid = user[config.ldap.useridField]
}
var username = uuid
if (config.ldap.usernameField && user[config.ldap.usernameField]) {
username = user[config.ldap.usernameField]
}