How to use the ldapjs.BindRequest function in ldapjs

To help you get started, we’ve selected a few ldapjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flamencist / ldap4net / .test_config / index.js View on Github external
var ldap = require('ldapjs');

var old = ldap.DN.prototype.format;
ldap.DN.prototype.format = function(options){
  options = options || {};
  options.skipSpace = true;
  options.keepCase = true;
  return old.call(this,options);
};

var bindRequestOld = ldap.BindRequest.prototype._parse;
ldap.BindRequest.prototype._parse = function(ber){
  try{
    return bindRequestOld.call(this, ber);
  }catch(e){
    this.authentication = ber.readString(0xa3);
    this.name = "cn=digestTest,dc=example,dc=com";
    this.credentials = "test";
    return true;
  }
};


ldap.BindResponse.prototype._parse = function(ber) {
  assert.ok(ber);

  if (!ldap.LDAPResult.prototype._parse.call(this, ber)) {
github flamencist / ldap4net / .test_config / index.js View on Github external
var ldap = require('ldapjs');

var old = ldap.DN.prototype.format;
ldap.DN.prototype.format = function(options){
  options = options || {};
  options.skipSpace = true;
  options.keepCase = true;
  return old.call(this,options);
};

var bindRequestOld = ldap.BindRequest.prototype._parse;
ldap.BindRequest.prototype._parse = function(ber){
  try{
    return bindRequestOld.call(this, ber);
  }catch(e){
    this.authentication = ber.readString(0xa3);
    this.name = "cn=digestTest,dc=example,dc=com";
    this.credentials = "test";
    return true;
  }
};


ldap.BindResponse.prototype._parse = function(ber) {
  assert.ok(ber);

  if (!ldap.LDAPResult.prototype._parse.call(this, ber)) {
    return false