node-activedirectory icon indicating copy to clipboard operation
node-activedirectory copied to clipboard

How to do a custom filter for uid instead of sAMAccountName

Open ORESoftware opened this issue 8 years ago • 0 comments

hey, this is working for me, but now we are switching to using a custom filter.

We are using the ad.findUser() method

Instead of this standard filter

filter: '(sAMAccountName={{username}})'

we need this:

filter: '(uid={{username}})'

is that the right way to use a filter with your library? I am guessing that it's not. Please help! thanks

I assume the way to do it would be:

let adconfig = {
  url: config.ldap.url,
  baseDN: config.ldap.searchBase,
  username: config.ldap.bindDn,
  password: config.ldap.bindCredentials,
  filter: '(uid={{username}})'
};

let ad = new ActiveDirectory(adconfig);

ORESoftware avatar Jun 09 '17 19:06 ORESoftware