Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ldap:context-source id="contextSource"
- url="ldaps://xxx.xxx.xx:636"
- username="cn=xx,ou=apps,dc=xxx,dc=xxx"
- base="ou=people,dc=xxx,dc=xxx"
- password="xxx"
- />
- <bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
- <constructor-arg ref="contextSource" />
- </bean>
- private LdapName buildDn(String value) {
- return LdapNameBuilder.newInstance()
- .add("cn", "FIRST LAST")
- .build();
- }
- public Person findById(String cn){
- LdapName dn = buildDn(cn);
- EsbLdapPerson p = null;
- p = ldapTemplate.lookup(dn, PERSON_CONTEXT_MAPPER);
- return p;
- }
- I get a error at lookup Caused by: javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=FIRST LAST' error.
- Lookup by "uid" works fine.
- Any help is appreciated.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement