DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Set userPassword attribute in ADAM using LDAP+JNDI

  1. #1
    Join Date
    Jun 2007

    Set userPassword attribute in ADAM using LDAP+JNDI

    I am trying to set the attribute "userPassword" for an Organization Unit (OU). I have used SHA algorithm for encrypting the password.For example ,the encrypted password that i got is "TmmQPaHwGiohpiziJUKVGXgZX9k="

    I am storing this encrypted password to the attribute "userPassword".

    I am getting the following error :

    Problem resetting password: [LDAP: error code 16 - 00000057: LdapErr: DSID-0C090B3D, comment: Error in attribute conversion operation, data 0, va28

    Here is the functtion that i used for setting the password.
    "Encrypt" is the function that returns the encrypted value of the password string.

    Can anyone help me on this issue? or if there is any other easy way to set the UserPassword attribute?

    public boolean setPassword(String orgUnit,String Pass) throws NamingException, NoSuchAlgorithmException
    String newUnicodePassword=encrypt(Pass);
    ModificationItem[] mods = new ModificationItem[1];
    mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute("userPassword", newUnicodePassword));
    System.out.println("Set password & updated userccountControl");
    return true;
    catch (NamingException e) {
    System.out.println("Problem resetting password: " + e);

    catch (UnsupportedEncodingException e) {
    System.out.println("Problem encoding password: " + e);
    return false;

  2. #2
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    Instead of resetting it can you flat out delete it and create a new one?

Similar Threads

  1. Input string was not in a correct format
    By mdengler in forum ASP.NET
    Replies: 0
    Last Post: 11-26-2002, 03:32 PM
  2. Create Procedure
    By YC Choo in forum Database
    Replies: 5
    Last Post: 09-03-2001, 01:42 PM
  3. Creating XML document using DOM
    By Gee in forum XML
    Replies: 2
    Last Post: 06-14-2001, 12:19 PM
  4. simple XML APPENDING problem
    By scopee in forum XML
    Replies: 4
    Last Post: 04-13-2001, 03:31 AM
  5. Replies: 1
    Last Post: 12-23-2000, 09:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center