GH-33 Allow non-DN binds for AD

This commit is contained in:
Mark Cavage 2011-11-09 14:57:22 -08:00
parent df159475c8
commit 6b6eaadf6d
2 changed files with 4 additions and 9 deletions

View File

@ -216,7 +216,7 @@ Client.prototype.bind = function(name, credentials, controls, callback, conn) {
var self = this; var self = this;
var req = new BindRequest({ var req = new BindRequest({
name: (typeof(name) === 'string') ? dn.parse(name) : name, name: name,
authentication: 'Simple', authentication: 'Simple',
credentials: credentials, credentials: credentials,
controls: controls controls: controls

View File

@ -24,15 +24,10 @@ var LDAP_BIND_SASL = 'sasl';
///--- API ///--- API
function BindRequest(options) { function BindRequest(options) {
if (options) { if (options && typeof(options) !== 'object')
if (typeof(options) !== 'object') throw new TypeError('options must be an 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');
} else { options = options || {};
options = {};
}
options.protocolOp = Protocol.LDAP_REQ_BIND; options.protocolOp = Protocol.LDAP_REQ_BIND;
LDAPMessage.call(this, options); LDAPMessage.call(this, options);