diff --git a/lib/ldapauth.js b/lib/ldapauth.js index b825fc0..db662f0 100644 --- a/lib/ldapauth.js +++ b/lib/ldapauth.js @@ -82,6 +82,11 @@ var LDAP_PROXY_EVENTS = [ * retry {Object} Optional: * - maxDelay {Number} maximum amount of time between retries * - retries {Number} maximum # of retries + * attributes {Array} Optional + * Select a subset of the ldap user object attributes, by default + * all attributes are fetched and returned. + * Useful if your ldap database contains images of users and + * you dont need the images. */ function LdapAuth(opts) { assert.string(opts.url, 'opts.url'); @@ -110,7 +115,8 @@ function LdapAuth(opts) { retry: opts.retry || {}, tlsOptions: opts.tlsOptions, timeout: opts.timeout, - url: opts.url + url: opts.url, + attributes: opts.attributes || [] }; (function adminConnect() { self._adminConnecting = self._createClient(self._adminOpts, function (err, client) { @@ -286,7 +292,8 @@ LdapAuth.prototype._findUser = function (username, callback) { var searchFilter = self.opts.searchFilter.replace('{{username}}', username); var opts = { filter: searchFilter, - scope: 'sub' + scope: 'sub', + attributes: self.opts.attributes }; self._adminClient.search(self.opts.searchBase, opts, function (err, result) { diff --git a/package.json b/package.json index c940297..c10ed46 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "assert-plus": "0.1.4", "backoff": "2.3.0", "bcrypt": "0.7.5", - "ldapjs": "git+ssh://git@github.com:mcavage/node-ldapjs.git#fa1b8c4", + "ldapjs": "0.7.1", "lru-cache": "2.0.4", "once": "1.3.0" }