My scope is to authenticate only with
uid=User,dc=ldap,dc=com.
With this base I get the following error
LDAPException(resultCode=49 (invalid credentials), errorMessage='invalid credentials
')
I can succesfull authenticate with a Java application to an OpenLDAP
with the following base: uid=User,ou=People,dc=ldap,dc=com. So without writing the multiple organizational units that the user is part of.
I was also able to authenticate on a different environment to ActiveDirectory only with uid=User,dc=com but not on OpenLDAP
.
- Is there a setting on
OpenLDAP
that I missed? - Is there something in
Java
that I can use for workaround? I would prefer a solution withJNDI
.
In java I used JNDI
and also UnboundID for test. These are the java connection settings:
//JNDI Connection
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, url);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "uid=User,dc=com");
env.put(Context.SECURITY_CREDENTIALS, password);
//UnboundID connection
LDAPConnection ldapConnection = new LDAPConnection(ip, 389, "dc=ldap,dc=com", pswrd);
File ldap.conf:
BASE dc=ldap,dc=com
File slapd.conf:
suffix "dc=ldap,dc=com";
rootdn "cn=Manager,dc=ldap,dc=com"