Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-ldap-search

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-ldap-search

Simple LDAP Searching.

  • 3.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.9K
increased by267.63%
Maintainers
1
Weekly downloads
 
Created
Source

NPM Version

Searches LDAP. Nothing fancy.

A thin, promisified wrapper over LDAPjs's client.

Installation

$ npm install --save simple-ldap-search

Usage

import SimpleLDAP from 'simple-ldap-search';

const config = {
  url: 'ldap://0.0.0.0:1389',
  base: 'dc=users,dc=localhost',
  dn: 'cn=root',
  password: 'secret',
  // optionally pass tls options to ldapjs
  tlsOptions: {
    // tls options ...
  },
};

// create a new client
const ldap = new SimpleLDAP(config);

// setup a filter and attributes for your LDAP query
const filter = '(uid=artvandelay)';
const attributes = ['idNumber', 'uid', 'givenName', 'sn', 'telephoneNumber'];

// using async/await
const users = await ldap.search(filter, attributes);

// [{
//   dn: 'uid=artvandelay, dc=users, dc=localhost',
//   idNumber: 1234567,
//   uid: 'artvandelay',
//   givenName: 'Art',
//   sn: 'Vandelay',
//   telephoneNumber: '555-123-4567',
// }]

API

ldap.search(filter, attributes)

Parameters

  • filter: filters results.
  • attributes: a list of attributes to return

Returns

  • A promise for the results

ldap.destroy()

Destroys the connection to the LDAP server. Use when all done with LDAP client.

Keywords

FAQs

Package last updated on 27 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc