使用LDAP连接方法连接LDAP C#时出现无效凭据错误

时间:2020-03-23 03:17:24

标签: c# ssl ldap

LdapConnection ldapConnection = new LdapConnection("abc.com:636");

var networkCredential = new NetworkCredential(UserName,Password,"ou=users,dc=nonproduction");
ldapConnection.SessionOptions.SecureSocketLayer = true;
ldapConnection.SessionOptions.VerifyServerCertificate += delegate { return true; };
ldapConnection.AuthType = AuthType.Negotiate;
ldapConnection.Bind(networkCredential);

0 个答案:

没有答案