From 46d8047599bf827bfd8f8796f38e8e3bca7e1f65 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 26 Sep 2016 09:08:04 -0700 Subject: [PATCH] fix ldapjs usage --- src/ldap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ldap.js b/src/ldap.js index e1789ea91..a735ab5bf 100644 --- a/src/ldap.js +++ b/src/ldap.js @@ -250,8 +250,8 @@ function authenticateUser(req, res, next) { debug('user bind: %s (from %s)', req.dn.toString(), req.connection.ldap.id); // extract the common name which might have different attribute names - var attributeName = Object.keys(req.dn.rdns[0])[0]; - var commonName = req.dn.rdns[0][attributeName]; + var attributeName = Object.keys(req.dn.rdns[0].attrs)[0]; + var commonName = req.dn.rdns[0].attrs[attributeName].value; if (!commonName) return next(new ldap.NoSuchObjectError(req.dn.toString())); var api;