diff --git a/lib/client.js b/lib/client.js index 9691da4..029f527 100644 --- a/lib/client.js +++ b/lib/client.js @@ -216,7 +216,7 @@ Client.prototype.bind = function(name, credentials, controls, callback, conn) { var self = this; var req = new BindRequest({ - name: (typeof(name) === 'string') ? dn.parse(name) : name, + name: name, authentication: 'Simple', credentials: credentials, controls: controls diff --git a/lib/messages/bind_request.js b/lib/messages/bind_request.js index adddb86..086ddfb 100644 --- a/lib/messages/bind_request.js +++ b/lib/messages/bind_request.js @@ -24,15 +24,10 @@ var LDAP_BIND_SASL = 'sasl'; ///--- API function BindRequest(options) { - if (options) { - if (typeof(options) !== 'object') - throw new TypeError('options must be an object'); - if (options.name && !(options.name instanceof dn.DN)) - throw new TypeError('options.entry must be a DN'); + if (options && typeof(options) !== 'object') + throw new TypeError('options must be an object'); - } else { - options = {}; - } + options = options || {}; options.protocolOp = Protocol.LDAP_REQ_BIND; LDAPMessage.call(this, options);