ldap-authentication icon indicating copy to clipboard operation
ldap-authentication copied to clipboard

Add a method for getting all users?

Open thedjdoorn opened this issue 5 years ago • 3 comments

This would allow for more specific user management without needing an explicit username or password, something like:

  // auth with admin
  let options = {
    ldapOpts: {
      url: 'ldap://example.com',
      // tlsOptions: { rejectUnauthorized: false }
    },
    adminDn: 'cn=read-only-admin,dc=example,dc=com',
    adminPassword: 'password'
    // starttls: false
  }
  
  let user = await users(options)
  console.log(user)

A query for that would look like "uid=*,ou=people,dc=example,dc=com", I think this could be a great improvement to make the library powerful while also keeping it simple.

thedjdoorn avatar Apr 27 '20 16:04 thedjdoorn

I am debating if we should include this feature. The purpose of ldap-authentication is as the name indicates, authenticate a user. Adding getting all users may diverge from that goal.

shaozi avatar Sep 18 '20 05:09 shaozi

This feature would be great, I also need it.

mehmetkarakamis avatar Apr 22 '21 12:04 mehmetkarakamis

Just a note when implementing this: all LDAP servers have a limit how many entries will be returned when doing a simple search() (usually 1000). So when implementing this, add paged: true as option for ldapjs.

fabiang avatar Oct 10 '22 14:10 fabiang