From d6ee10d17645bed82ad39276fb4c26705edbacf9 Mon Sep 17 00:00:00 2001 From: Dustin Frisch Date: Thu, 1 Mar 2018 23:51:47 +0100 Subject: Introduce ldap.useridField Signed-off-by: Dustin Frisch --- lib/web/auth/ldap/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/web/auth') diff --git a/lib/web/auth/ldap/index.js b/lib/web/auth/ldap/index.js index cc0d29ad..c6746473 100644 --- a/lib/web/auth/ldap/index.js +++ b/lib/web/auth/ldap/index.js @@ -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] } -- cgit v1.2.3