I've managed to get the debugger working, thanks! Also, I've deleted a lot of extra code and used com.unboundid.util.ssl.SSLUtil instead. Thank you very much, you've been a great help!
Wow, thank you for all the answers, explanations and hints! I've only added the password policy request control as one of many attempts to obtain more information from the server. Without it, the response is pretty much the same, just without the control response: PasswordModifyExtendedResult(resultCode=19 (constraint violation), messageID=2, diagnosticMessage='Failed to update password') So your guess was most probably correct. I've investigated Apache Directory Studio code further and found out...
UPDATE v2 Okay, so the code is as follow: ... import com.unboundid.util.Base64; ... ModifyRequest modifyRequest = new ModifyRequest( "dn: " + user.getDn(), "changetype: modify", "replace: userPassword", "userPassword:: " + Base64.encode(newPassword); ); LDAPResult modifyResult = ldapManager.getLdapConnectionAsAdmin().modify(modifyRequest); And now it works just as expected... Last question: what is the purpose of PasswordModifyExtendedRequest then? Why does it not return the detailed message with...
UPDATE v2 Okay, so the code is as follow: ... import com.unboundid.util.Base64; ... ModifyRequest modifyRequest = new ModifyRequest( "dn: " + user.getDn(), "changetype: modify", "replace: userPassword", "userPassword:: " + Base64.encode(newPassword.getBytes()); ); LDAPResult modifyResult = ldapManager.getLdapConnectionAsAdmin().modify(modifyRequest); And now it works just as expected... Last question: what is the purpose of PasswordModifyExtendedRequest then? Why does it not return the detailed message...
UPDATE I've managed to get the message using a regular ModifyRequest like that: ModifyRequest modifyRequest = new ModifyRequest( "dn: " + user.getDn(), "changetype: modify", "replace: userPassword", "userPassword:: " + newPassword ); System.out.println(modifyRequest); LDAPResult modifyResult = ldapManager.getLdapConnectionAsAdmin().modify(modifyRequest); System.out.println(modifyResult); with a result, which is just perfect: LDAPException(resultCode=19 (constraint violation), errorMessage='invalid...
Hello, please, help me, as I am unable to find a way to detect a descriptive reason for password change denial. Using the following code: PasswordModifyExtendedRequest passwordModifyExtendedRequest = new PasswordModifyExtendedRequest(userDN, currPassword, newPassword, new Control[]{new Control("1.3.6.1.4.1.42.2.27.8.5.1")}); passwordModifyExtendedRequest.setResponseTimeoutMillis(1000); LDAPConnection ldapConnection = ldapManager.getLdapConnection(); PasswordModifyExtendedResult extendedResult = (PasswordModifyExtendedResult)...