I have an issue with LDAP connection. When I try to connect with apache directory studio desktop I succesfully autheticate. But when I try to do this with Java it fails. I think that the problem is in username which contains backslash "\".
LdapConnection connection = new LdapNetworkConnection(ldapIp, ldapPort);
connection.bind( "uid=foo\\bar,ou=example,dc=example,dc=com", "mysEcretpa55" );
In this case it say that
Exception in thread "main" org.apache.directory.api.ldap.model.exception.LdapInvalidDnException: unexpected token: b
When I put 4 slashes it say:
LdapErr: DSID-0C0903C8, comment: AcceptSecurityContext error, data 52e, v2580
I read that 52e is an error of bad credentials. I'll repeat again that I verified in apache directory studio desktop application and it works fine.