From 476177380452c9c7c5b1624805feedc824c5995e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 5 May 2020 01:19:03 +0200 Subject: Make listen port and ldap filter more flexible --- src/auth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/auth.js b/src/auth.js index 5f4c777..d575d60 100644 --- a/src/auth.js +++ b/src/auth.js @@ -71,8 +71,8 @@ function verifyUser(username, password, callback) { ldapClient.bind(process.env.CLOUDRON_LDAP_BIND_DN, process.env.CLOUDRON_LDAP_BIND_PASSWORD, function (error) { if (error) return callback(error); - var filter = `(|(uid=${username})(mail=${username})(username=${username})(sAMAccountName=${username}))`; - ldapClient.search(process.env.CLOUDRON_LDAP_USERS_BASE_DN, { filter: filter }, function (error, result) { + var filter = process.env.CLOUDRON_LDAP_FILTER.replace(/\{username\}/g, username); + ldapClient.search(process.env.CLOUDRON_LDAP_USERS_BASE_DN, { filter: filter, scope: "sub" }, function (error, result) { if (error) return callback(error); var items = []; -- cgit v1.2.3