From 6b6eaadf6d74854d0248e23596541c938dd69807 Mon Sep 17 00:00:00 2001 From: Mark Cavage Date: Wed, 9 Nov 2011 14:57:22 -0800 Subject: [PATCH] GH-33 Allow non-DN binds for AD --- lib/client.js | 2 +- lib/messages/bind_request.js | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) 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);