* @throws BssException
*/
public void setUserPassword(JsonJavaObject userCredentialObject, boolean bypassPolicy) throws BssException {
try {
String serviceUrl = BssUrls.API_AUTHENTICATION_SETUSERPASSWORD.format(this, new NamedUrlPart("bypassPolicy", bypassPolicy ? "true" : "false"));
Response response = createData(serviceUrl, null, JsonHeader, userCredentialObject, ClientService.FORMAT_JSON);
// expect a 204
int statusCode = response.getResponse().getStatusLine().getStatusCode();
if (statusCode != 204) {
throw new BssException(response, "Error setting one time password {0}", userCredentialObject);
}
} catch (Exception e) {
throw new BssException(e, "Error setting one time password {0} caused by {1}", userCredentialObject, e.getMessage());