Announcement Announcement Module
Collapse
No announcement yet.
How to retrieve userPassword attribute on ldapTemplate 1.0.2 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to retrieve userPassword attribute on ldapTemplate 1.0.2

    Hi All,

    As written on the subject, how can I achieve that?
    I am using ldapTemplate 1.0.2 since I am now extending a third party application that is using that version of ldapTemplate, which I believe is the earlier version of Spring-LDAP.

    Currently I'm able to get operational attributes by using this following code, but only userPassword attributes is not returned.

    Code:
    SearchControls controls = new SearchControls();
    controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
    controls.setReturningObjFlag(false);
    controls.setReturningAttributes(new String[]{"userPassword","uid","initials"});
    //controls.setReturningAttributes(null);
    
    List result = ldapTemplate.search("", LdapUtils.getFilterWithValues(filter, principal.toString()), controls, new AttributesMapper() {
    	public Object mapFromAttributes(Attributes attrs) throws NamingException {
    		Attribute attrUid = attrs.get("uid");
    		Attribute attrInitials = attrs.get("initials");
    
     .... lines omitted ...
    Regards,
    Sukma

  • #2
    Update:

    I am trying to get these objects:
    controls.setReturningAttributes(new String[]{"userPassword","uid","initials","pwdHistory","ent ryUUID","modifyTimestamp"});
    but only uid, initials, entryUUID, modifyTimestamp attributes returned.

    Does ldapTemplate 1.0.2 able to handle attribute in binary format?

    Comment


    • #3
      It depends on the server, but sometimes userPassword is not readable (for obvious reasons...)

      Comment

      Working...
      X