diff --git a/src/addons.js b/src/addons.js index 6556c4a24..d1c551d39 100644 --- a/src/addons.js +++ b/src/addons.js @@ -289,7 +289,9 @@ function setupLdap(app, callback) { 'LDAP_PORT=3002', 'LDAP_URL=ldap://172.17.42.1:3002', 'LDAP_USERS_BASE_DN=ou=users,dc=cloudron', - 'LDAP_GROUPS_BASE_DN=ou=groups,dc=cloudron' + 'LDAP_GROUPS_BASE_DN=ou=groups,dc=cloudron', + 'LDAP_BIND_DN=cn='+ app.id + ',ou=apps,dc=cloudron', + 'LDAP_BIND_PASSWORD=' + hat(256) // this is ignored ]; debugApp(app, 'Setting up LDAP'); diff --git a/src/ldap.js b/src/ldap.js index b2dd6e1e3..3d01ab47c 100644 --- a/src/ldap.js +++ b/src/ldap.js @@ -63,7 +63,6 @@ function start(callback) { if ((req.dn.equals(dn) || req.dn.parentOf(dn)) && req.filter.matches(tmp.attributes)) { res.send(tmp); - debug('ldap user send:', tmp); } }); @@ -100,7 +99,6 @@ function start(callback) { if ((req.dn.equals(dn) || req.dn.parentOf(dn)) && req.filter.matches(tmp.attributes)) { res.send(tmp); - debug('ldap group send:', tmp); } }); @@ -108,8 +106,14 @@ function start(callback) { }); }); - gServer.bind('dc=cloudron', function(req, res, next) { - debug('ldap bind: %s', req.dn.toString()); + gServer.bind('ou=apps,dc=cloudron', function(req, res, next) { + // TODO: validate password + debug('ldap application bind: %s', req.dn.toString()); + res.end(); + }); + + gServer.bind('ou=users,dc=cloudron', function(req, res, next) { + debug('ldap user bind: %s', req.dn.toString()); if (!req.dn.rdns[0].cn) return next(new ldap.NoSuchObjectError(req.dn.toString()));