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

node-ldap

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ldap

node ldap client

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

node-ldap

node ldap client

安装

npm install node-ldap

使用

已通过Windows Server 2008测试


var LdapClient = RedisClient('node-ldap');

var client = new LdapClient({
    ldapUrl: 'ldap://192.168.1.81:389',
    userDn: 'administrator@ad.yliyun.com',
    password: 'yliyun@123'
});


 // 用户认证
client.auth('administrator@ad.yliyun.com', 'yliyun@123').then(function() {
    console.log('success');
}).catch(function(err) {
    console.error(err);    
});

// 搜索部门
client.searchOU('dc=ad,dc=yliyun,dc=com').then(function(ous) {
    console.log(ous);
}).catch(function(err) {
    console.error(err);    
});

// 搜索用户
client.searchUser('dc=ad,dc=yliyun,dc=com').then(function(users) {
    console.log(users);
}).catch(function(err) {
    console.error(err);    
});

// 搜索
client.searchUser({
    base: 'dc=ad,dc=yliyun,dc=com',
    scope: 'sub', // 默认为'one'
    paged: 'true', // 默认为true
    filter: '(objectclass=organizationalUnit)'
}).then(function(rows) {
    console.log(rows);
}).catch(function(err) {
    console.error(err);    
});

// 断开连接
client.disconnect();


Keywords

FAQs

Package last updated on 23 Jun 2016

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