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 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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue