5
        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!

BreakHead
  • 10,480
  • 36
  • 112
  • 165

1 Answers1

12

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"));
    }
Alan
  • 456
  • 2
  • 9