Announcement Announcement Module
Collapse
No announcement yet.
Updating password / unicodepwd fails Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Updating password / unicodepwd fails

    Hi,

    We are using Spring LDAP 1.3.1 to create and modify user records on an Active Directory on Windows 2008. We use the SSL connection when required (e.g. to initially set the password for a user we are creating)

    Now we are trying to implement a "update password" functionality and running into an issue. We can successfully update all of the other user attributes except password. Is there a special way we need to do this using Spring LDAP?


    Code:
    DirContextOperations context = simpleLdapTemplate.lookupContext( buildDn( identifier ) );
    
    try {
             context.setAttributeValue( "unicodepwd", encodePassword( myNewPassword ) );
             //context.setAttributeValue( "userPassword", myNewPassword);
           } catch( UnsupportedEncodingException uee ) { 
             throw uee;
           }
    
    // THIS LINE THROWS EXCEPTION
    simpleLdapTemplate.modifyAttributes( context );
    The last line results in the following Exception

    Code:
    org.springframework.ldap.AttributeInUseException: [LDAP: error code 20 - 0000207E: AtrErr: DSID-03190647, #1:
           0: 0000207E: DSID-03190647, problem 1006 (ATT_OR_VALUE_EXISTS), data 0, Att 9005a (unicodePwd)


    Thanks for your help.

  • #2
    Just an update: we were able to successfully change the password using the native Microsoft tools using the same "admin" user our Spring LDAP implementation uses. It doesn't seem to be a permissions issue... Is there anything special about Spring LDAP handling of passwords? Has anyone tested updating passwords?

    Thanks.

    Comment


    • #3
      encodePassword

      Could you post your encodePassword() ?

      you might want to talk a look at this post:
      http://forum.springsource.org/showthread.php?t=99013
      Last edited by thai; May 5th, 2011, 01:10 PM.

      Comment


      • #4
        I'm having the same problem.

        String newQuotedPassword = "\"" + newPassword + "\"";
        byte[] encoded = Base64.encodeBase64(newQuotedPassword.getBytes("UT F-16LE"));
        DirContextAdapter entry = (DirContextAdapter) ldapTemplate.lookup(ldapPerson.getDn());
        entry.setAttributeValue("unicodePwd", encoded);
        ldapTemplate.modifyAttributes(entry);

        org.springframework.ldap.AttributeInUseException: [LDAP: error code 20 - 0000207E: AtrErr: DSID-0319061E, #1:
        0: 0000207E: DSID-0319061E, problem 1006 (ATT_OR_VALUE_EXISTS), data 0, Att 9005a (unicodePwd)


        Any solution?

        Comment

        Working...
        X