Query LDAP error: The distinguished name contains invalid syntax.

Jun 4, 2014 at 12:07 AM
Hello,

I've been stuck with an error while getting started with Linq to LDAP. I have a query that returns the error: "The distinguished name contains invalid syntax".
using (LdapConnection connection = new LdapConnection("ldap.service"))
{
    using (var context = new DirectoryContext(connection))
    {
        IDirectoryAttributes user = context.Query(namingContext, objectClass: "User").Where("uid=XXXX").FirstOrDefault();

        return user.GetString("field");
    }
}
I've tried mapping as well and continue to get the same error. Any ideas what I'm doing wrong?

Thank you in advance for any help,
-Victor
Jun 4, 2014 at 12:19 AM
Ahh nevermind. I just found that the AuthType had to be set to Anonymous. Thanks for a great library.

-Victor