How to use the ldapjs.InsufficientAccessRightsError 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
function authorize(req, res, next) {
  /* Any user may search after bind, only cn=root has full power */
  var isSearch = (req instanceof ldap.SearchRequest);
  if (!req.connection.ldap.bindDN.equals('cn=admin,dc=example,dc=com'))
    return next(new ldap.InsufficientAccessRightsError());

  return next();
}
github PhilWaldmann / openrecord / test / ldap / __server.js View on Github external
function authorize(req, res, next) {
  /* Any user may search after bind, only cn=root has full power */
  var isSearch = req instanceof ldap.SearchRequest
  if (!req.connection.ldap.bindDN.equals('cn=root') && !isSearch) {
    return next(new ldap.InsufficientAccessRightsError())
  }

  return next()
}
github trueaccord / FallingRock / server.js View on Github external
function authorize(req, res, next) {
  /* Any user may search after bind, only cn=root has full power */
  if (!req.connection.ldap.bindDN.equals(config.admin.username)) {
    return next(new ldap.InsufficientAccessRightsError());
  }

  return next();
}
github thelounge / thelounge / test / plugins / auth / ldap.js View on Github external
function authorize(req, res, next) {
		const bindDN = req.connection.ldap.bindDN;

		if (bindDN in authorizedUsers) {
			return next();
		}

		return next(new ldap.InsufficientAccessRightsError());
	}
github strongloop / microgateway / test / support / ldap-server / ldap-methods.js View on Github external
function authorize(req, res, next) {
    if (authreq === false) {
      return next();
    }
    if (!(req.connection.ldap.bindDN.equals('cn=root') ||
        req.connection.ldap.bindDN.equals('uid=alice, ou=people, dc=sixfour1, dc=com'))) {
      return next(new ldap.InsufficientAccessRightsError());
    }
    return next();
  }
github 4minitz / 4minitz / tests / support / ldap-server.js View on Github external
function authorize(req, res, next) {
    if (!req.connection.ldap.bindDN.equals('cn=ldapUser1,dc=example,dc=com'))
        return next(new ldap.InsufficientAccessRightsError());

    return next();
}
github conjurinc / teleport / lib / ldap.js View on Github external
function authenticate(req, res, next) {
	if ( req.connection.ldap.bindDN )
		return next();
	else
    return next(new ldap.InsufficientAccessRightsError());
}
github marklogic-community / marklogic-samplestack / appserver / node-express / lib / ldapWorker.js View on Github external
function authorize(req, res, next) {
  if (!req.connection.ldap.bindDN.equals('cn=root')) {
    return next(new ldap.InsufficientAccessRightsError());
  }

  return next();
}