Changes the password for the given user.

@param string $username
@param string $password
557978
public function changePassword($username, $password)
    {
        $user = $this->findUserByUsernameOrThrowException($username);
        $user->setPlainPassword($password);
        $this->userManager->updateUser($user);

        $event = new UserEvent($user, $this->getRequest());
        $this->dispatcher->dispatch(Events::USER_PASSWORD_CHANGED, $event);
    }
921927
public static function setDefaultAdmin($username, $password)
    {
        // don't overwrite if already set
        if (static::hasDefaultAdmin()) {
            throw new BadMethodCallException(
                "Default admin already exists. Use clearDefaultAdmin() first."
            );
        }

        if (empty($username) || empty($password)) {
            throw new InvalidArgumentException("Default admin username / password cannot be empty");
        }

        static::$default_username = $username;
        static::$default_password = $password;
        static::$has_default_admin = true;
    }
1238204
public function login($username, $password)
    {
        $data = $this->matrix()->request('POST', $this->endpoint('login'), [
            'type' => 'm.login.password',
            'user' => $username,
            'password' => $password
        ]);
        $this->setData($data);
        return $this->data;
    }
1079661
public function setUserInfo($user = null, $password = null)
	{
		$this->user = $user;
		$this->pass = $password;
		return $this;
	}
477583
public function setPassword($password){
        if(!$this->setModified('password', $password)->isModified()){
            return $this;
        }
        $this->password = $password;
        $this->passwordChanged = true;
        return $this;
    }
838488
public function changeUserPassword($user, $password)
    {
        $params = [
            'name' => $user,
            'password' => $password,
        ];

        $body = $this->request(self::URI_AUTH_USER_CHANGE_PASSWORD, $params);

        return $body;
    }
892064
public function authCredentials(string $username, string $password): self
    {
        $this->username = $username;
        $this->password = $password;
        return $this;
    }
1205297
public function setPassword($password)
    {
        if(!$this->isValidPassword($password)){
            return false;
        }

        if ($this->setPasswordStatement === null) {
            $this->setPasswordStatement = $this->connection->prepare("UPDATE User SET password=? WHERE username=?");
            $this->setPasswordStatement->bindParam(1, $this->password);
            $this->setPasswordStatement->bindParam(2, $this->username);
        }
        $wasLoggedIn = $this->isLoggedIn();
        $this->password = $this->hashPassword($password);
        $this->setPasswordStatement->execute();

        if ($wasLoggedIn) {

            $this->updateLoginSession();
        }

        return true;
    }
934189
public function login($username, $password)
    {
        $args = array($username, $password);
        $token = $this->_soapAdapter->call('login', $args);
        $this->setToken($token);
        return $token;
    }
681375
public function setPassword($password)
    {
        if ($this->username === null) {
            throw new InvalidConfigException('用户名不能为空');
        }
        
        $this->password = md5($password . $this->username);
    }
160915
public static function changePassword($user = null, $password)
	{
		$passhash = self::getPasshash($password);

		return self::changePasshash($user, $passhash);
	}
694869
public function basicAuth($username, $password)
    {
        $this->auth = new BasicAuth($username, $password);
        return $this->auth;
    }
862383
public function setup($userName, $password) {
        // we MUST have the username and password. No Blanks allowed!
        //
        // remove blanks else Empty doesn't work
        $userName = trim($userName);
        $password = trim($password);

        if (empty($userName) || empty($password)) {
            //Throw exception if the required parameters were not found
            $this->log('parameters did not include username and/or password');
            throw new RequiredParameterMissingException('One or more required parameters was not supplied. Both userName and password required!');
        }

        $this->userName = $userName;
        $this->password = $password;
    }
409556
public function setPassword($password = null)
    {
        if (empty($password)) {
            $password = $this->getEmptyPasswordSpecialty();
        }
        $phAttribute = $this->passwordHashAttribute;
        if (empty($phAttribute) || !is_string($phAttribute)) {
            return;
        }
        $this->$phAttribute = $this->generatePasswordHash($password);
        $this->_password = $password;
        $this->trigger(static::$eventAfterSetPassword);
    }
616764
public function changePassword(UserPassword $aPassword)
    {
        $this->password = $aPassword;
        $this->rememberPasswordToken = null;
        $this->updatedOn = new \DateTimeImmutable();
    }
587835
public function setPassword(string $password) : void
    {
        $this->password_hash = Yii::$app->security->generatePasswordHash($password);
    }
1245008
@Override
    public void changePassword(String username, String password)
            throws AuthenticationException {
        String user = file_store.getProperty(username);
        if (user == null) {
            throw new AuthenticationException("User '" + username
                    + "' not found.");
        }
        // Encrypt the new password
        String ePwd = encryptPassword(password);
        file_store.put(username, ePwd);
        try {
            saveUsers();
        } catch (IOException e) {
            throw new AuthenticationException("Error changing password: ", e);
        }
    }