Change Password APIedit


A user’s password can be changed using the security().changePassword() method:

ChangePasswordRequest request = new ChangePasswordRequest("change_password_user", newPassword, RefreshPolicy.NONE);
EmptyResponse response =, RequestOptions.DEFAULT);


The returned EmptyResponse does not contain any fields. The return of this response indicates a successful request.

Asynchronous Executionedit

This request can be executed asynchronously:, RequestOptions.DEFAULT, listener); 

The ChangePassword request to execute and the ActionListener to use when the execution completes.

The asynchronous method does not block and returns immediately. Once the request has completed the ActionListener is called back using the onResponse method if the execution successfully completed or using the onFailure method if it failed.

A typical listener for a EmptyResponse looks like:

ChangePasswordRequest request = new ChangePasswordRequest("change_password_user", password, RefreshPolicy.NONE);
ActionListener<EmptyResponse> listener = new ActionListener<EmptyResponse>() {
    public void onResponse(EmptyResponse response) {

    public void onFailure(Exception e) {

Called when the execution is successfully completed. The response is provided as an argument.

Called in case of failure. The raised exception is provided as an argument.