Validates the password for the current given user.

@param string $password The plain user input password.
@return boolean
438138
public function validatePassword($password)
    {
        return Yii::$app->security->validatePassword($password.$this->password_salt, $this->password);
    }
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;
    }
822106
public static function validatePassword($password)
    {
        $data = [
            'password' => $password
        ];

        $rule = [
            'password' => 'min:6'
        ];

        $validator = Validator::make($data, $rule);

        if ($validator->fails()) {
            $msg = $validator->errors()->getMessages();
            $errorString = DataFormatter::validationErrorsToString($msg);
            throw new BadRequestException('Invalid data supplied.' . $errorString, null, null, $msg);
        }
    }
1279584
public function verify($password): bool {
        if ($password instanceof StringClass || $password instanceof PasswordClass) {
            return password_verify($password->getValue(), $this->getValue());
        }
        return password_verify($password, $this->getValue());
    }
1133015
public function actionValidatePassword($user, $password)
    {
        $user = $this->getUser($user);
        $result = $user->validatePassword($password);
        if ($result) {
            echo "Correct.\n";
        } else {
            echo "Incorrect.\n";
        }
        return static::EXIT_CODE_NORMAL;
    }
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;
		}
	}
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();
    }
649536
protected static function filterPassword($password)
    {
        if ($password !== null && ! is_string($password)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid user-info; password must be a string argument; received %s',
                (is_object($password) ? get_class($password) : gettype($password))
            ));
        }

        return $password;
    }
1157750
public function needsRehash(string $password): bool
    {
        return password_needs_rehash($password, $this->hashType, $this->hashOptions);
    }
761506
public function checkUserCredentials($username, $password)
    {
        if ($user = $this->getUser($username)) {
            return $this->checkPassword($user, $password);
        }

        return false;
    }
982493
function validatePassword( $password )
    {
        eZDebug::writeDebug( 'Validate Password Start','eZPaEx::validatePassword' );
        if ( $this->hasRegexp() && ( $password != '_ezpassword' ) )
        {
            $regexp = preg_replace( array('/(^\/)/', '/(\/$)/'), '', $this->attribute( 'passwordvalidationregexp' ) );
            if ( !preg_match( '/' . $regexp . '/', $password ) )
            {
                eZDebug::writeDebug( 'Password KO', 'eZPaEx::validatePassword' );
                return false;
            }
        }
        eZDebug::writeDebug( 'Password OK', 'eZPaEx::validatePassword' );

        return true;
    }
124861
public function loginWithPassword($password)
    {
        $this->password = $password;
        if (is_readable($this->challengeFilename)) {
            $challengeData = file_get_contents($this->challengeFilename);
            if ($challengeData) {
                $this->challengeData = $challengeData;
            }
        }
        $login = new Login($this, $this->password);
        $login->doLogin();
    }
1027404
public function resetPassword($password)
    {
        try {
            return (bool)$this->updateAttributes(['password_hash' => PasswordHelper::hash($password)]);
        } catch (Exception $e) {
            return false;
        }
    }
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;
    }
1362940
function checkPassword($password)
    {
        if ($this->password == '') {
            return false;
        }
        list ($algo, $salt, $hash) = explode(':', $this->password);
        if ($hash == $algo($salt . $password)) {
            return true;
        } else {
            return false;
        }
    }
63537
public function authenticate(string $password): bool
    {
        $hash = $this->get('hashed_password');

        $isHashed = null !== $hash;
        if (!$isHashed) {
            // If there is no hashed password, fake verify with default hash.
            $hash = Grav::instance()['config']->get('system.security.default_hash');
        }

        // Always execute verify() to protect us from timing attacks, but make the test to fail if hashed password wasn't set.
        $result = Authentication::verify($password, $hash) && $isHashed;

        $plaintext_password = $this->get('password');
        if (null !== $plaintext_password) {
            // Plain-text password is still stored, check if it matches.
            if ($password !== $plaintext_password) {
                return false;
            }

            // Force hash update to get rid of plaintext password.
            $result = 2;
        }

        if ($result === 2) {
            // Password needs to be updated, save the user.
            $this->set('password', $password);
            $this->undef('hashed_password');
            $this->save();
        }

        return (bool)$result;
    }
783616
private function containsAtLeastOneUpperCaseCharacter(string $password): bool
    {
        if ($this->constraints['requireAtLeastOneUpperCaseCharacter']) {
            return (bool)preg_match(self::AT_LEAST_ONE_UPPER_CASE_CHARACTER_REGEX, $password);
        }

        return true;
    }