Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Problem binding to active directory special characters #981

Open
ips219 opened this issue May 7, 2024 · 1 comment
Open

Problem binding to active directory special characters #981

ips219 opened this issue May 7, 2024 · 1 comment

Comments

@ips219
Copy link

ips219 commented May 7, 2024

Hello...

I've an strange issue when binding to an Active Directory Server. I am trying to authenticate the user using ldapjs.
This is my code which works fine with most users...
`
var connectionSettings = {
url: LDAP_URL,
bindDN: "domain\ipindado",
bindCredentials: LDAP_ADMIN_PASSWORD
};

      const client = ldap.createClient({ url: [connectionSettings .url]  });

    client.bind(connectionSettings.bindDN, connectionSettings.bindCredentials, (err: Error | null) => {
      if (err) {
        console.error('Error...:', err);
      } else {
        console.log('Sucess...');
      }
    });

`
Note that I am making the simple binding using "domain\samaccountname" instead of DistinguisedName

But I have some issues with some specific users, when the DistinguisedName conmtains special characters like áéíóú as for example

"dn": "CN=Jos\c3\a9 Ignacio Gonzalez,OU=Externos_O365,OU=BU,DC=domain,DC=local",

The strange thing is that I'm not using the DN for binding, I am using samaccountname with domain "domain\jigonzalez" which works fine for most of the users.

And we have also testested removing the special characters in the Active Directory and authentication works fine for these users after removing the characters.

Did any body faced something similar?

Thanks and Best regards.

@WanpengQian
Copy link

When bind failed, for some users, can you check the server event log?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants