diff options
author | Christoph (Sheogorath) Kern | 2018-03-03 23:56:01 +0100 |
---|---|---|
committer | GitHub | 2018-03-03 23:56:01 +0100 |
commit | 96c9096d508813b76e87509d23d3497eed90a1c2 (patch) | |
tree | 1dc2228372e95de7f84ea9d8e6cc6b3453f34906 /lib/web/auth/ldap | |
parent | b0ce3d0230a104fe6e4e136f8ecb57a87c6d264b (diff) | |
parent | d6ee10d17645bed82ad39276fb4c26705edbacf9 (diff) |
Merge pull request #750 from fooker/master
Use ldap.usernameField over hardcoded uid fields
Diffstat (limited to 'lib/web/auth/ldap')
-rw-r--r-- | lib/web/auth/ldap/index.js | 5 |
1 files changed, 4 insertions, 1 deletions
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] } |