Advertisement
Guest User

Untitled

a guest
Jan 6th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <ldap:context-source id="contextSource"
  2. url="ldaps://xxx.xxx.xx:636"
  3.  
  4. username="cn=xx,ou=apps,dc=xxx,dc=xxx"
  5. base="ou=people,dc=xxx,dc=xxx"
  6. password="xxx"
  7. />
  8.  
  9. <bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
  10. <constructor-arg ref="contextSource" />
  11. </bean>
  12.  
  13. private LdapName buildDn(String value) {
  14. return LdapNameBuilder.newInstance()
  15. .add("cn", "FIRST LAST")
  16. .build();
  17. }
  18.  
  19. public Person findById(String cn){
  20. LdapName dn = buildDn(cn);
  21. EsbLdapPerson p = null;
  22. p = ldapTemplate.lookup(dn, PERSON_CONTEXT_MAPPER);
  23. return p;
  24. }
  25.  
  26. I get a error at lookup Caused by: javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=FIRST LAST' error.
  27.  
  28. Lookup by "uid" works fine.
  29. Any help is appreciated.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement