question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ldapjs search in production doesn't work

See original GitHub issue

I’m creating a desktop app with Electron, I use ldapjs to create a connection to Actice Directory Domain Service (ADDS). When I test the app in development environment everything work, but when I create an .exe the method bind works but search always return an empty array.

Search code:

const client = ldapjs.createClient({ url: credentials.LDAP_NAME, reconnect: true });
client.bind(credentials.USER_NAME, credentials.PASSWORD, (err) => {
   if (err) {
     return err;
   };
   const results = [];
   client.search(config.DN, options, [], (err, res) => {
      res.on('searchEntry', (entry) => {
        results.push(entry.object);
      });
      res.on('searchReference', (referral) => {
        console.log(`referral: ${referral.uris.join()}`);
      });
      res.on('error', (err) => {
        console.log(`error: ${err.message}`);
        if (err) {
          client.destroy();
          resolve(results);
        }
      });
      res.on('end', (result) => {
        console.log(result.status);
        client.destroy();
        resolve(results);
      });
    });
});

When I get console logs the result is 0 and array results is []

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tastypacketscommented, Jun 21, 2019

This repo is pretty much abandoned last I knew, you can check out ldapts for a new & typescript version. https://github.com/ldapts/ldapts#readme

1reaction
ncampuzanocommented, Mar 23, 2019

Maybe that’s the reason, because today I was testing ldapts library (which supports 8.15+) and everything work fine.

What do you think? I should be use this library and try to downgrade the node version or use the other library (it’s a recent project, I’m afraid about bugs)

How did you solve it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ldapjs search is not working - Stack Overflow
I'm trying to search in ldapjs using method 'search', but it is not working for me. Here is response from terminal :
Read more >
ldapjs-client - npm Package Health Analysis - Snyk
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix advice.
Read more >
LDAP Guide - ldapjs
Most people don't know how LDAP works, other than that "it's that thing ... Really, the power of LDAP comes through the search...
Read more >
Troubleshooting LDAP - GitLab Docs
On the left sidebar, select Overview > Users. Search for the user. Open the user by selecting their name. Do not select Edit....
Read more >
Use LDAP and Active Directory to authenticate Node.js users
In theory, you could just open the LDAP server to the Internet—but that violates ... This code builds the filter and uses it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found