GH-33 Allow non-DN binds for AD
This commit is contained in:
parent
df159475c8
commit
6b6eaadf6d
|
@ -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
|
||||
|
|
|
@ -24,15 +24,10 @@ var LDAP_BIND_SASL = 'sasl';
|
|||
///--- API
|
||||
|
||||
function BindRequest(options) {
|
||||
if (options) {
|
||||
if (typeof(options) !== 'object')
|
||||
if (options && 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');
|
||||
|
||||
} else {
|
||||
options = {};
|
||||
}
|
||||
options = options || {};
|
||||
|
||||
options.protocolOp = Protocol.LDAP_REQ_BIND;
|
||||
LDAPMessage.call(this, options);
|
||||
|
|
Loading…
Reference in New Issue