i want to get userPassword attribute from ldap using spring in java.
of course this not work:
context.getStringAttribute("userPassword");
If i try:
context.getObjectAttribute("userPassword");
i can get this attribute..but now from Object how i can get the hash password?
It sounds like context.getObjectAttribute("userPassword") returns an Object so you just need to identify what it is.
Based on the comments it was a byte[] array which was representing a String, so you can basically do this:
Object o = context.getObjectAttribute("userPassword");
byte[] bytes = (byte[]) o;
String hash = new String(bytes);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With