1

I use npm install ldapjs to use this library. And simple bind code:

var ldap = require('ldapjs');
var client = ldap.createClient({
  url: 'ldap://192.168.1.90:389'
})

const baseDN = 'dc=mnw-inc,dc=com'

export function login(username, password) {
  client.bind(rootDN, rootpasswd, function(err, res) {
    // here handle response
  })
}

This is a react app and I run the app. I got this error in consol

Uncaught TypeError: net.connect is not a function
at connectSocket (client.js:1039)
at Backoff.<anonymous> (client.js:1203)
at Backoff../node_modules/events/events.js.EventEmitter.emit (events.js:84)
at Backoff../node_modules/backoff/lib/backoff.js.Backoff.onBackoff_ (backoff.js:53)

When I call the login() function nothing return at all. What could I do?

鸡肉味嘎嘣脆
  • 233
  • 1
  • 3
  • 15
  • hi @鸡肉味嘎嘣脆 did you resolve this issue? i am struggling with ldap client for react application with the same erro but without any luck. are you using any other library? – VladoDemcak Jan 31 '18 at 18:42
  • 1
    @VladoDemcak I didn't resolve this. This is name conflict. I put ldapjs to server side. And it's works well on server side. – 鸡肉味嘎嘣脆 Feb 01 '18 at 02:29

0 Answers0