Skip to content

Commit 71c4e79

Browse files
authored
Merge pull request #99 from nagaflokhu/ensure-groupDnProperty-is-selected
Make sure groupDnProperty is requested from LDAP server
2 parents 756413d + 741a648 commit 71c4e79

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/ldapauth.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,12 @@ LdapAuth.prototype._findUser = function(username, callback) {
324324
opts.attributes = self.opts.searchAttributes;
325325
}
326326

327+
// groupDnProperty will be accessed in the user returned by the search, and
328+
// so needs to be requested from the LDAP server.
329+
if (self.opts.groupDnProperty && !opts.attributes.includes(self.opts.groupDnProperty)) {
330+
opts.attributes.push(self.optss.groupDnProperty)
331+
}
332+
327333
self._search(self.opts.searchBase, opts, function(err, result) {
328334
if (err) {
329335
self.log && self.log.trace('ldap authenticate: user search error: %s %s %s', err.code, err.name, err.message);

0 commit comments

Comments
 (0)