Get value for LDAP Attribute "userPassword" of type binary using Java1.4
843785Oct 15 2008 — edited Jul 8 2009Hi,
I am using Sun Java 1.4 and trying to extract the value of an LDAP attribute "userPassword" which is of type binary. While doing this I get an value which is different than the password stored in the IBM Tivoli v5 for eg "[B@61db22" rather the encrypted string in SHA1. Could any help me out with this.
The snap shot of the code which I am using to retrieve the userPassword Attribute is as shown below :
if(attribute.getID().equals("userPassword")){
attribute = attributes.get("userPassword");
String struserPassword = attribute.toString();
//Object strValue = attribute.get();
//logger.info("Object ::"+strValue);
//logger.info("Class of the User Password ::"+strValue.getClass().toString());
String aUserPswd[]= struserPassword.split(":");
for (int i = 1 ; i < aUserPswd.length ; i++) {
String struserPasswordValue = aUserPswd.toString().trim();
fl.setPassword(struserPasswordValue.toString()); // setting the obtained value in xml format
}
}