0
votes

I'm trying to authenticate a user using LDAP for Windows Server for AD authentication. Below is my code:

 string domList = "LDAP://172.21.0.1:389/CN=Configuration,DC=myDom,DC=local;
 System.DirectoryServices.DirectoryEntry deRoot = new System.DirectoryServices.DirectoryEntry(domList, userNameURL, password, authType);
                                    deRoot.RefreshCache();

This works fine in most cases, I have one particular site where I get an invalid username/password error.

If I change the username to be of the format myDom\username then it works. However I only want the user to enter their username. I don't see why the domain is needed as it's part of the LDAP connection string. Any ideas why this is happening?

1

1 Answers

0
votes

This turned out to be a red herring. I need to set the authentication type to be secure