Validate password.

@param string $password Password or Password Hash.
@return boolean
774270
public function validatePassword($password)
    {
        if (static::judgePasswordHash($password)) {
            return $this->{$this->passwordHashAttribute} == $password;
        }
        return Yii::$app->security->validatePassword($password, $this->{$this->passwordHashAttribute});
    }
788929
protected function passwordNeedsUpdate($password = null) : bool
    {
        $current = $this->currentModelPassword();

        if ($current !== null && $this->canSync()) {
            return ! Hash::check($password, $current);
        }

        return is_null($current);
    }
562969
public static function validate($password, $hash) {
        $params = explode(":", $hash);
        if (count($params) < 4)
            return false;
        $pbkdf2 = base64_decode($params[self::$hash_pbkdf2_index]);
        return self::slowEquals(
                $pbkdf2, self::calculate(
                    $params[self::$hash_alogrithm_index], $password, $params[self::$hash_salt_index], (int) $params[self::$hash_iteration_index], strlen($pbkdf2), true
                )
        );
    }
43329
public function verifyPassword(string $password): bool
    {
        $this->requiresAccessToken();

        try {
            $response = $this->send(
                'POST',
                'auth/verify',
                $this->getApiHeaders(),
                $this->mergeApiBody(compact('password'))
            );
        } catch (UnauthorizedException $e) {
            return false;
        }

        return $response->toArray()['success'] === true;
    }
917251
public function setPassword($password)
    {
      if(!is_string($password) && strlen(trim($password)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid password, must be a non empty string');

      $this->password = $password;
    }
1245935
protected function authenticate($username, $password)
    {
        if (!isset($username)) {
            return ValidationResult::error("username isn't set");
        }
        
        if (!isset($password)) {
            return ValidationResult::error("password isn't set");
        } 
        
        if (!isset(self::$users[$username]) || !password_verify($password, self::$users[$username]['password'])) {
            return ValidationResult::error("Invalid credentials");
        }

        return ValidationResult::success();
    }
761506
public function checkUserCredentials($username, $password)
    {
        if ($user = $this->getUser($username)) {
            return $this->checkPassword($user, $password);
        }

        return false;
    }
157329
public function is_valid($password, $check_rehash=true) {
	if (password_verify($password, $this->data['hash']) == false) {
		return false;
	}
	
	if ($check_rehash && password_needs_rehash($this->data['hash'], PASSWORD_DEFAULT)) {
		$new_hash = self::hash_password($password);
		$this->set_new_hash($this->data['user_id'], $this->data['email_address'], $new_hash);
	}
	
	return true;
}
335018
public static function verify($password, $hash){
        // Pre PHP 5.5 support
        if (!defined('PASSWORD_DEFAULT') || substr($hash,0,4)=='$5h$') {
            return '$5h$'.hash('sha1',$password) == $hash;
        } else {
            return password_verify($password,$hash);
        }
    }
205072
public function login($password)
    {
        if (!$this->exists() ||
            !$this->verifyLogin($password) ||
            $this->someOneLoggedIn()
        ) {
            return false;
        }

        if ($this->lastLoginStatement === null) {
            $this->lastLoginStatement = $this->connection->prepare("UPDATE User SET lastLogin = FROM_UNIXTIME(?) WHERE username = ?");
            $this->lastLoginStatement->bindParam(1, $this->lastLogin);
            $this->lastLoginStatement->bindParam(2, $this->username);

        }
        $this->lastLogin = time();
        $this->lastLoginStatement->execute();


        $this->updateLoginSession();
        $this->notifyObservers(User::EVENT_LOGIN);
        return true;
    }
994501
private function containsAtLeastOneNumericCharacter(string $password): bool
    {
        if ($this->constraints['requireAtLeastOneNumericCharacter']) {
            return (bool)preg_match(self::AT_LEAST_ONE_NUMERIC_CHARACTER_REGEX, $password);
        }

        return true;
    }
1153801
public function login(string $password) : bool {
		if (!$this->confirmed) {
			return false;
		} elseif ($this->isLoggedIn()) {
			return true;
		} elseif ($this->doesPasswordMatch($password)) {

			// Requires a started session
			$loginToken = $this->sessionManager->login();
			$_SESSION["user_id"] = $this->id;
			$_SESSION["login_token"] = $loginToken;
			return true;
		} else {
			return false;
		}
	}
328725
public function validatePassword(string $password): bool
    {
        $this->A1 = md5($this->digestParts['username'].':'.$this->realm.':'.$password);

        return $this->validate();
    }
455425
public function validatePassword($password) {
        return Yii::$app->czaHelper->password->validate($password, $this->password_hash);
//        return Yii::$app->security->validatePassword($password, $this->password_hash);
    }
598602
public function validatePassword($password)
    {
        $model = static::findIdentity($this->username, $password);

        return (bool) $model->id;
    }
1313216
private function containsAtLeastOneLowerCaseCharacter(string $password): bool
    {
        if ($this->constraints['requireAtLeastOneLowerCaseCharacter']) {
            return (bool)preg_match(self::AT_LEAST_ONE_LOWER_CASE_CHARACTER_REGEX, $password);
        }

        return true;
    }
869119
public static function verify($password, $hash): int
    {
        // Fail if hash doesn't match
        if (!$password || !$hash || !password_verify($password, $hash)) {
            return 0;
        }

        // Otherwise check if hash needs an update.
        return password_needs_rehash($hash, PASSWORD_DEFAULT) ? 2 : 1;
    }