using (LdapConnection ldap = new LdapConnection("localhost:389"))
{
//ldap.AuthType = AuthType.Basic;
ldap.Bind(new NetworkCredential("cn=manager,dc=wave,dc=com", "secret"));
}
I tried with both with Authentication type as well with authentication type as basic. but it gives an error that 'The distinguished name contains invalid syntax'
One more thing, is that I can't use System.DirectoryServices, because it works perfect only for Active Directory, thats why I am using System.DirectoryServices.Protocol.
Thanks!
This MSDN blog post may shed some light on your problem. Try this:
using (LdapConnection ldap = new LdapConnection("localhost:389"))
{
ldap.AuthType = AuthType.Basic;
ldap.SessionOptions.ProtocolVersion = 3;
ldap.Bind(new NetworkCredential("cn=manager,dc=wave,dc=com", "secret"));
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With