Validates a user password
@return boolean|null
348968
protected function validateUserPasswordInstall()
    {
        $field = 'user.password';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);
        $label = $this->translation->text('Password');

        if (empty($value)) {
            $this->setErrorRequired($field, $label);
            return false;
        }

        list($min, $max) = $this->user->getPasswordLength();

        $length = mb_strlen($value);

        if ($length < $min || $length > $max) {
            $this->setErrorLengthRange($field, $label, $min, $max);
            return false;
        }

        return true;
    }
56210
public function authenticate($username, $password)
    {
        try {
            $user = $this->userProvider->loadUserByUsername($username);
        } catch (UsernameNotFoundException $e) {
            return null;
        }

        $valid = $this->encoderFactory->getEncoder($user)->isPasswordValid(
            $user->getPassword(),
            $password,
            $user->getSalt()
        );

        if ($valid) {
            return $user;
        }

        return null;
    }
1039666
public function validateUserPassword($attributes, $params)
    {
        $this->_user = Users::model()->findByPk(Yii::app()->user->id);

        if ($this->_user == NULL)
        {
            $this->addError('password', Yii::t('HybridAuth.main', 'Unable to identify user.'));
            return false;
        }

        $hash = Users::model()->encryptHash($this->_user->email, $this->password, Yii::app()->params['encryptionKey']);

        $result = password_verify($hash, $this->_user->password);

        if ($result == false)
        {
            $this->addError('password', Yii::t('HybridAuth.main', 'The password you entered is invalid.'));
            return false;
        }

        return true;
    }
462773
public function isValid($username, $password, array $role = array())
    {
        foreach ($this->data as $user => $pass) {
            if ($user == $username && $pass == $password) {
                return true;
            }
        }

        return false;
    }
806001
protected function isValid()
    {
        if (!$this->request->ajax()) {
            return false;
        }
        $search = $this->request->input('search');
        if (!is_string($search) or strlen($this->request->input('search')) <= 0) {
            return false;
        }
        $token = $this->request->header('search-protection');
        if (!$this->validateToken($token)) {
            return false;
        }
        return true;
    }
981650
public function validate($token)
    {
        $autologin = $this->provider->findByToken($token);

        if ($autologin && $this->autologinValid($autologin)) {
            if (config('autologin.count')) {
                $autologin->incrementCount();
            }

            return $autologin;
        }

        return null;
    }
748088
public function validatePassword($password)
    {
        try {
            return Yii::$app->security->validatePassword($password, $this->password_hash);
        } catch (Exception $e) {
            return false;
        }
    }
1180372
protected function checkAuthInput()
    {
        
        $defaults = array('user' => null,
						  'password' => null);
						  
		$this->options = array_merge($defaults, $this->options);
		
		if ($this->options['user'] == null) {
			$this->err("Please provide a value for the 'user' parameter.", true);
		}
		else if ($this->options['password'] == null) {
			$this->err("Please provide a value for the 'password' parameter.", true);
		}
        
    }
598602
public function validatePassword($password)
    {
        $model = static::findIdentity($this->username, $password);

        return (bool) $model->id;
    }
1130812
protected function validateEmail()
    {
        $field = 'email';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if ($this->isUpdating() && !isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $label = $this->translation->text('E-mail');

        if (empty($value)) {
            $this->setErrorRequired($field, $label);
            return false;
        }

        if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        return 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);
        }
    }
1088299
private function getPassword(): ? string
    {
        $password = $this->secret("Enter your password");
        $passwordAgain = $this->secret("Enter your password again");

        $validator = Validator::make([
            'password' => $password,
            'password_confirmation' => $passwordAgain,
        ], [
            'password' => 'required|min:6|confirmed',
        ]);

        if ($validator->fails()) {
            $this->info('');
            $this->error("The password must be at least 5 characters and must match!");
            $this->info('');

            return $this->getPassword();
        }

        $this->password = $password;

        return null;
    }
49945
public function validate(string $password): bool
    {
        foreach ($this->validators as $validator) {
            $validator->validate($password);
        }

        return true;
    }
781789
private function validateCredentials($object, $password)
    {
        return !(
            null === $object
            || !$this->passwordHasher->compareWith($object->getPassword(), $password)
        );
    }
503356
public function validate(array $creds = []) : bool {
      $user = '';
      $pass = '';

      //Check for user keys
      foreach (self::USER_KEYS as $key) {
          if (isset($creds[$key])) {
              $user = $creds[$key];
          }
      }

      //Check for password keys
      foreach (self::PASSWORD_KEYS as $key) {
          if (isset($creds[$key])) {
              $pass = $creds[$key];
          }
      }

      $decrypted = Assist::hash(Assist::decrypt($this->password));

      if ($this->username === $user && $decrypted === $pass) {
          return true;
      }

      return false;
  }
1314446
public function authenticate()
	{
		$user=User::model()->find('LOWER(username)=?',array(strtolower($this->username)));
		if($user===null)
			$this->errorCode=self::ERROR_USERNAME_INVALID;
		else if(!$user->validatePassword($this->password))
			$this->errorCode=self::ERROR_PASSWORD_INVALID;
		else
		{
			$this->_id=$user->id;
			$this->username=$user->username;
			$this->errorCode=self::ERROR_NONE;
		}
		return $this->errorCode==self::ERROR_NONE;
	}
520325
protected function validateUserLogin()
    {
        $this->setSubmitted('user', null, false);
        $this->filterSubmitted(array('email', 'password'));
        $this->validateComponent('user_login');

        return !$this->hasErrors();
    }