Log in a user with username and password.
If successful the retrieves OAUTH access tokens.

@deprecated

@param $username
@param $password

@return \GuzzleHttp\Promise\PromiseInterface
@throws \Exception
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;
            }
        );
    }
933669
public function setHttpAuth(string $username, string $password = ''): AbstractApi
    {
        $this->httpAuth['username'] = $username;
        $this->httpAuth['password'] = $password;

        return $this;
    }
441913
public function getUser($username, $password)
    {
        $authHash = $this->hashUserNameAndPassword($username, $password);
        $body     = json_encode(['clientType' => 'wp-plugin']);

        try {
            $response = $this->client->post(
              $this->loginurl, [
                'headers' => ['Authorization' => 'Basic ' . $authHash],
                'verify'  => $this->certFile,
                'body'    => $body //wp-plugin value makes session not expire
              ]);
            $this->response = $response->getBody();

        } catch (ClientException $e) {
            $response       = [
              'code'     => $e->getCode(),
              'response' => $e->getMessage(),
              'error'    => true
            ];
            $this->response = json_encode($response);

        } catch (ConnectException $e) {
            $message = 'Can not connect to Leadpages Server:';
            $response = $this->parseException($e, $message);
            $this->response = $response;
        }

        return $this;
    }
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;
    }
921527
public function updatePassword($username, $password)
    {
        $parameters['username'] = $username;
        $parameters['password'] = $password;
        return $this->apiClient->callEndpoint(
            sprintf('%s/avatars', self::ENDPOINT),
            $parameters,
            null,
            HttpMethod::REQUEST_PUT
        );
    }
1041525
public function login($username = 'anonymous', $password = '')
    {
        $result = $this->ftp->login($username, $password);

        if ($result === false) {
            throw new FtpException('Login incorrect');
        }

        return $this;
    }
943121
public function login($username = null, $password = null)
    {
        if (false === @$this->cd()) {
            if (true === @$this->mkdir()) {
                @$this->cd();
            } else {
                throw new Exception\AuthenticationException(sprintf('Unable to change dir to %s', $this->_remotepath));
            }
        }

        return $this;
    }
424174
public static function logIn($username, $password)
    {
        if (!$username)
        {
            throw new AVException("Cannot log in user with an empty name");
        }
        if (!$password)
        {
            throw new AVException("Cannot log in user with an empty password.");
        }
        $data = array("username" => $username, "password" => $password);
        $result = AVClient::_request("GET", "/login", "", $data);
        $user = new AVUser();
        $user->_mergeAfterFetch($result);
        $user->handleSaveResult(true);
        AVClient::getStorage()->set("user", $user);

        return $user;
    }
742296
public function login(?string $username, ?string $password)
    {
        try {
            $this->startBrokerSession();

            if (!$username || !$password) {
                $this->fail('No username and/or password provided.');
            }

            if (!$this->authenticate($username, $password)) {
                $this->fail('User authentication failed.');
            }
        } catch (SSOServerException $e) {
            return $this->returnJson(['error' => $e->getMessage()]);
        }

        $this->setSessionData('sso_user', $username);

        return $this->userInfo();
    }
665176
public function login( $username, $password )
	{
		$this->checkConnection( TRUE, FALSE );
		if( !@ftp_login( $this->resource, $username, $password ) )
			return FALSE;
		$this->auth	= TRUE;
		return TRUE;
	}
198764
public function authenticate($username, $password)
    {
        $result = $this->getGateway()->authenticate($username, $password);
        $messages = $result->getMessages();

        // all messages beyond the first one are for debugging and
        // not suitable to display to the user.
        foreach ($messages as $i => $message) {
            if ($i > 0) {
                $this->getLogger()->debug(str_replace("\n", "\n  ", $message));
            }
        }

        $message = $messages[0]; // first message is user readable, suitable for showing on login form

        // show better errors than the defaults for various status codes returned by LDAP
        if (!empty($messages[1]) && strpos($messages[1], 'NT_STATUS_ACCOUNT_LOCKED_OUT') !== false) {
            $message = _t(
                __CLASS__ . '.ACCOUNTLOCKEDOUT',
                'Your account has been temporarily locked because of too many failed login attempts. ' .
                'Please try again later.'
            );
        }
        if (!empty($messages[1]) && strpos($messages[1], 'NT_STATUS_LOGON_FAILURE') !== false) {
            $message = _t(
                __CLASS__ . '.INVALIDCREDENTIALS',
                'The provided details don\'t seem to be correct. Please try again.'
            );
        }

        return [
            'success' => $result->getCode() === 1,
            'identity' => $result->getIdentity(),
            'message' => $message,
            'code' => $result->getCode()
        ];
    }
1119318
public function login($username, $password)
    {
        $model       = $this->slice->getRequired('model');
        $loginFields = $this->slice->getRequired('loginFields');
        $hashField   = $this->slice->getRequired('hashField');

        $userQuery = $this->provider->auth()->orm()->repository($model);

        foreach ($loginFields as $field)
        {
            $userQuery->whereOr($field, $username);
        }

        $user = $userQuery->findOne();

        if ($user && $this->verify($password, $user->get($hashField)))
        {
            $this->provider->setUser($user);
        }

        return $user;
    }
1060955
public function getToken($username, $password)
    {
        try {
            return $this->bizImpl->getToken($username, $password);
        } catch (\Throwable $throwable) {
            throw new SystemException($throwable->getMessage(), $throwable->getCode());
        }
    }
532767
public static function signIn($username , $password)
	{
		$ip = self::getClientIp();
		$ua = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? $_SERVER['HTTP_USER_AGENT'] : '';
		$ts = date("U");

		if ( self::isValidPassword($username , $password) ) {

			self::sessionWrite( array( 'username' => $username ) );
			self::reload();
			self::$auth['users'][ $username ]['logincount'] = (int) @self::$auth['users'][ $username ]['logincount'] + 1;
			self::$auth['users'][ $username ]['lastlogin'] = array(
				'ip' => $ip,
				'ua' => $ua,
				'ts' => $ts
			);
			self::log( 'signin' , $username , $ts , $ip , $ua );
			self::save();

			return self::$auth['users'][ $username ];
		}

		self::log( 'signinerr' , $username , $ts , $ip , $ua );
		self::save();

		return false;
	}
209416
public function amHttpAuthenticated($username, $password)
    {
        if ($this->isFunctional) {
            $this->client->setServerParameter('PHP_AUTH_USER', $username);
            $this->client->setServerParameter('PHP_AUTH_PW', $password);
        } else {
            $this->client->setAuth($username, $password);
        }
    }
1330885
public function amHttpAuthenticated($username, $password)
    {
        $this->client->setServerParameter('PHP_AUTH_USER', $username);
        $this->client->setServerParameter('PHP_AUTH_PW', $password);
    }
376749
public function auth($password)
    {
        $response = $this->__call('auth', [$password]);
        $this->setPassword($password);

        return $response;
    }