Change the password for the currently logged in user. You must supply the
old password and the new password.

@param username
@param oldPassword
@param newPassword
@return
178098
public ApiResponse changePassword(String username, String oldPassword,
            String newPassword) {

        Map<String, Object> data = new HashMap<String, Object>();
        data.put("newpassword", newPassword);
        data.put("oldpassword", oldPassword);

        return apiRequest(HttpMethod.POST, null, data, organizationId,  applicationId, "users",
                username, "password");

    }
893240
protected static function changePasswordBySecurityAnswerWithUsername($username, $answer, $newPassword, $login)
    {
        return static::changePasswordBySecurityAnswer(
            static::getEmailByUsername($username),
            $answer,
            $newPassword,
            $login
        );
    }
644573
def modify_password(self, username, newpwd, oldpwd):
        
        ret = self.command(
            'userManager.cgi?action=modifyPassword&name={0}&pwd={1}'
            '&pwdOld={2}'.format(username, newpwd, oldpwd)
        )
        return ret.content.decode('utf-8')
564229
public function changePasswordWithRecoveryToken(User $user, int $tokenId, string $token, string $newPassword)
    {
        if (!$this->resetTokenProvider) {
            throw new PasswordResetProhibitedException('The configuration currently prohibits the resetting of passwords!');
        }

        $auth = $this->authenticationProvider->findByUserId($user->getId());
        if (!$auth) {
            throw new NoSuchUserException();
        }

        $remote = new RemoteAddress();
        $remote->setUseProxy(true);

        $resetToken = $this->resetTokenProvider->get($tokenId);
        if (!$resetToken) {
            throw new InvalidResetTokenException();
        }

        if (!$resetToken->isValid($auth, $token, $remote->getIpAddress(), $this->validateFingerprint, $this->validateIp)) {
            throw new InvalidResetTokenException();
        }

        $this->resetPassword($user, $newPassword);
        $resetToken->setStatus(UserResetTokenInterface::STATUS_USED);
        $this->resetTokenProvider->update($resetToken);
    }
1002004
@Help(help = "Change a user's password")
  public void changePassword(String oldPassword, String newPassword) throws SDKException {
    HashMap<String, String> requestBody = new HashMap<>();
    requestBody.put("old_pwd", oldPassword);
    requestBody.put("new_pwd", newPassword);

    requestPut("changepwd", requestBody);
  }
545464
def change_password(self, new_password, email):
        
        log.info("[+] Changing the password of the account")
        return self._send_xmpp_element(account.ChangePasswordRequest(self.password, new_password, email, self.username))
438865
public function changePassPhrase($old_passphrase, $new_passphrase)
    {
        $args = [
            (string)$old_passphrase,
            (string)$new_passphrase
        ];
        return null === $this->rpc->query("walletPassPhraseChange", $args);
    }
1136257
public void setPassword(String username, String newPassword) throws CmsException {

        m_securityManager.setPassword(m_context, username, newPassword);
    }
151734
function changePassword(masterPassword, newPassword1, newPassword2) {
    if (newPassword1 !== newPassword2) throw new Error("New passwords must match.");
    else {
        var contents = getContents(masterPassword);
        init(newPassword1, contents);
    }
}
1254180
def setNewPassword(self, url, username, password):
        
        self.br.add_password(url, username, password)
1196603
public void authenticate(String username, String password) {
		logger.debug("Authenticate:" + username);

		Authentication request = new UsernamePasswordAuthenticationToken(username, password);
		authenticationManager.authenticate(request);
	}
1080092
@Nonnull
  public EChange setUserPassword (@Nullable final String sUserID, @Nonnull final String sNewPlainTextPassword)
  {
    // Resolve user
    final User aUser = getOfID (sUserID);
    if (aUser == null)
    {
      AuditHelper.onAuditModifyFailure (User.OT, sUserID, "no-such-user-id", "password");
      return EChange.UNCHANGED;
    }

    // Create a new password salt upon password change
    final PasswordHash aPasswordHash = GlobalPasswordSettings.createUserDefaultPasswordHash (new PasswordSalt (),
                                                                                             sNewPlainTextPassword);
    m_aRWLock.writeLock ().lock ();
    try
    {
      final EChange eChange = aUser.setPasswordHash (aPasswordHash);
      if (eChange.isUnchanged ())
        return EChange.UNCHANGED;

      BusinessObjectHelper.setLastModificationNow (aUser);
      internalUpdateItem (aUser);
    }
    finally
    {
      m_aRWLock.writeLock ().unlock ();
    }
    AuditHelper.onAuditModifySuccess (User.OT, "password", sUserID);

    // Execute callback as the very last action
    m_aCallbacks.forEach (aCB -> aCB.onUserPasswordChanged (aUser));

    return EChange.CHANGED;
  }
647280
public static SanePasswordProvider forUsernameAndPassword(
      final String username, final String password) {
    return new SanePasswordProvider() {
      @Override
      public String getUsername(String resource) {
        return username;
      }

      @Override
      public String getPassword(String resource) {
        return password;
      }

      @Override
      public boolean canAuthenticate(String resource) {
        return true;
      }
    };
  }
762809
public static boolean changePassword(String userName, String newPassword) {
        LOGGER.entering(userName, newPassword.replaceAll(".", "*"));
        boolean changeSucceeded = false;
        File authFile = new File(AUTH_FILE_LOCATION);
        try {
            authFile.delete();
            authFile.createNewFile();
            createAuthFile(authFile, userName, newPassword);
            changeSucceeded = true;
        } catch (Exception e) {
            changeSucceeded = false;
        }
        LOGGER.exiting(changeSucceeded);
        return changeSucceeded;
    }
1134125
async def change_user_password(self, username, password):
        
        user_facade = client.UserManagerFacade.from_connection(
            self.connection())
        entity = client.EntityPassword(password, tag.user(username))
        return await user_facade.SetPassword([entity])
1048084
@Override
    public void setPassword(final String password) {
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
            SibTr.debug(this, TRACE, "setPassword", "***");
        }
        _password = password;
    }
1071880
@POST
  @Path("me/password")
  @RolesAllowed({"ROLE_ADMIN", "ROLE_USER"})
  public Response changePassword(@Context HttpServletRequest request, PasswordRequest passwordRequest) {
    checkPasswordFormat(passwordRequest.getNewPassword());
    checkNotNull(passwordRequest.getOldPassword());

    // Only allow changing your own password
    Long userId = (Long) request.getAttribute(OAuth2Filter.NAME_USER_ID);
    userService.changePassword(userId, passwordRequest.oldPassword, passwordRequest.getNewPassword());

    return Response.noContent().build();
  }