Results 1 to 3 of 3

Thread: How to retrieve userPassword attribute on ldapTemplate 1.0.2

  1. #1
    Join Date
    Jan 2007
    Posts
    4

    Question 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. #2
    Join Date
    Jan 2007
    Posts
    4

    Default

    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?

  3. #3
    Join Date
    Jul 2005
    Location
    Helsingborg, Sweden
    Posts
    504

    Default

    It depends on the server, but sometimes userPassword is not readable (for obvious reasons...)
    Ulrik Sandberg
    Jayway (www.jayway.com)
    Spring LDAP project member

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •