Announcement Announcement Module
Collapse
No announcement yet.
Error casting ldap userPassword to String Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error casting ldap userPassword to String

    I am using springldap framework in my application,but there is a problem I can't cast it to String what can I do?

    Code:
    String userPassword = (String) attributes.get("userPassword").get();
    		 if (userPassword != null)
    		 contactDTO.setUserPassword(userPassword);

    and the ERROR is :

    java.lang.ClassCastException

  • #2
    Well, if it's not a String you can't cast it to a String. My guess is that it is hashed in the LDAP entry and will be returned back to you as a byte array (of course, this means that returning the password back to the client is essentially useless, as there is no way of getting the actual password, just the hash).

    Comment

    Working...
    X