is it possible to get the User-Password from TDS in ClearText via java?
With ldapsearch -v -D cn=root -w xxxxxx -s sub uid=testuser userPassword
i'm getting the following result:
The password is in that case: Joko2014!
In Java i have tried it with:
String[] attrIDs = {".....",....,"userPassword"}
SearchControls ctls = new SearchControls();
ctls.setReturningAttributes(attrIDs);
ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
NamingEnumeration<SearchResult> results = ctx.search(name,
filter, ctls);
while (results.hasMore()) {
SearchResult entry = results.next();
System.out.println(entry);
}
But the output in the console is just:
uid=testuser: null:null:{givenname=givenName: xxxx, sn=sn: xxx, pwdchangedtime=pwdChangedTime: 20160926173016.000000Z, mail=mail: xxxxxx@xx.xxx.com, uid=uid: testuser, userpassword;binary=userPassword;binary: [B@1a626f, pwdreset=pwdReset: true, cn=cn: xxxx, description=description: xxxxxx;xxxxxx;I;xxxxxx}
What does "binary=userPassword;binary:[B@1a626f..." mean and how can i get the password here? Do i have to encode it? If yes, how can i solve it? Getting the other operational attributes are no problem.
Best Regards!