Tell whether a password is valid or not

@param string $username the username
@param string $password the password

@return boolean
978790
public static function isValidPassword($username , $password)
	{
		if ( ! self::userExists( $username ) ) return false;
		$compute = self::getPasswordHash($username , $password);

		return ( $compute === self::$auth['users'][$username]['pwd'] );
	}
1176263
public function validateUserName($userName)
    {
        if (empty($userName)) {
            $this->addError('userName', 'User name cannot be empty');
            return false;
        }

        if (!is_string($userName)) {
            $this->addError('userName', 'User name must be a string');
            return false;
        }

        if (mb_strlen($userName, 'UTF-8') > 255) {
            $this->addError('userName', 'User name length has to be less or equal to 255');
            return false;
        }


        return true;
    }
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());
    }
1033192
public function login($username = '', $password = '')
    {
        if (!$this->connected) {
            $this->setError('Not connected to POP3 server');
        }
        if (empty($username)) {
            $username = $this->username;
        }
        if (empty($password)) {
            $password = $this->password;
        }

        // Send the Username
        $this->sendString("USER $username" . static::LE);
        $pop3_response = $this->getResponse();
        if ($this->checkResponse($pop3_response)) {
            // Send the Password
            $this->sendString("PASS $password" . static::LE);
            $pop3_response = $this->getResponse();
            if ($this->checkResponse($pop3_response)) {
                return true;
            }
        }

        return false;
    }
1127956
public function checkPassword($password)
    {
        Deprecation::notice('5.0', 'Use Authenticator::checkPassword() instead');

        // With a valid user and password, check the password is correct
        $result = ValidationResult::create();
        $authenticators = Security::singleton()->getApplicableAuthenticators(Authenticator::CHECK_PASSWORD);
        foreach ($authenticators as $authenticator) {
            $authenticator->checkPassword($this, $password, $result);
            if (!$result->isValid()) {
                break;
            }
        }
        return $result;
    }
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;
    }
922197
public function login($username, $password)
    {
        $stmt = $this->conn->prepare(
            sprintf("SELECT user_id, user_name, user_pass
			FROM %s WHERE user_name = :name LIMIT 1", $this->table));
        $stmt->execute(['name' => $username]);

        $result = $stmt->fetch(\PDO::FETCH_ASSOC);

        if ($result['user_name'] !== $username) {
            return false;
        }

        if ($this->hasher->CheckPassword($password, $result['user_pass'])) {
            // Clear previous session
            $this->session->regenerate();
            // Write new data to session
            $data = [
                'id' => $result['user_id'],
                'logged_' . $this->table => true
            ];
            $this->session->set('user', $data);
            return true;
        }
        return false;
    }
373148
public function updatePassword($username, $password)
    {
        /** @var UserInterface|EloquentUser $user */
        if ( ! ($user = $this->sentinel->findByCredentials(['email' => $username]))) {
            return false;
        }

        return $this->sentinel->update($user, ['password' => $password]) instanceof UserInterface;
    }
434049
public function Login ($username = '', $password = '') {
    if ($this->connected == false) {
      $this->error = 'Not connected to POP3 server';

      if ($this->do_debug >= 1) {
        $this->displayErrors();
      }
    }

    if (empty($username)) {
      $username = $this->username;
    }

    if (empty($password)) {
      $password = $this->password;
    }

    $pop_username = "USER $username" . $this->CRLF;
    $pop_password = "PASS $password" . $this->CRLF;

    //  Send the Username
    $this->sendString($pop_username);
    $pop3_response = $this->getResponse();

    if ($this->checkResponse($pop3_response)) {
      //  Send the Password
      $this->sendString($pop_password);
      $pop3_response = $this->getResponse();

      if ($this->checkResponse($pop3_response)) {
        return true;
      } else {
        return false;
      }
    } else {
      return false;
    }
  }
329385
public function set_basic_auth($username, $password) {
		$value = 'Basic '.base64_encode($username.':'.$password);
		$this->set_header('Authorization', $value);
		return true;
	}
596334
public function validateLogin($email, $password)
    {
        $password = md5($password);

        $result = $this->fetchOne(
            "SELECT * FROM {$this->table} WHERE email = ? AND password = ?",
            array($email, $password)
        );

        if (!empty($result)) {
            return true;
        }

        return false;
    }
374277
protected static function validatePassword($password) {
		if (empty($password)) {
			throw new InvalidPasswordException();
		}

		$password = \trim($password);

		if (\strlen($password) < 1) {
			throw new InvalidPasswordException();
		}

		return $password;
	}
1187169
public function validate($username, $email, $password)
    {

        $error = array();

        if (!empty($email)) {
            if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
                $error['email'] = 'Invalid Email';
            }
            if ($email == $this->email) {
                $error['email'] = 'Email address is already registered';
            }
        } else {
            $error['email'] = 'You must enter your email address';
        }

        if (!empty($password)) {
            if (mb_strlen($password) < 8) {
                $error['password'] = 'Password must contain 8+ characters';
            } elseif (mb_strlen($password) > 255) {
                $error['password'] = 'Password is too long';
            }
        } else {
            $error['password'] = 'You must enter a password';
        }

        if (!empty($username)) {
            if (mb_strlen($username) < 4) {
                $error['username'] = 'Username must contain 4+ characters';
            } elseif (mb_strlen($username) > 255) {
                $error['username'] = 'Username too long';
            }
            if ($username == $this->username) {
                $error['username'] = 'Username is already registered';
            }
        } else {
            $error['username'] = 'You must enter a username';
        }

        return $error;
    }
52202
public function validatePassword($password)
    {
        $phAttribute = $this->passwordHashAttribute;
        $result = Yii::$app->security->validatePassword($password, $this->$phAttribute);
        if ($result) {
            $this->trigger(static::$eventValidatePasswordSucceeded);
            return $result;
        }
        $this->trigger(static::$eventValidatePasswordFailed);
        return $result;
    }
976726
public function userLogin($username, $password)
    {
        return $this->requestHandler->sendRequestAsync('POST', 'api/v4/users/login/',
            [
                'form_params' => [
                    'username' => $username,
                    'password' => $password
                ]
            ])->then(
            function ($result) {
                $this->requestHandler->setAccessTokenCredentials($result['tokenKey'], $result['tokenSecret']);
                return $result;
            }
        );
    }
75690
public function validatePassword( $password ) {

		if( isset( $password ) && isset( $this->passwordHash ) ) {

			return Yii::$app->getSecurity()->validatePassword( $password, $this->passwordHash );
		}

		return false;
	}
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;
    }