Set proxy authentication method to use

@param  string  $username The authentication username.
@param  string  $password The authentication password.
@param  integer $method   The authentication method.
@return \Beluga\Web\Http\Request
973896
public function proxyAuth( string $username = '', string $password = '', $method = \CURLAUTH_BASIC )
      : Request
   {

      $this->_proxy[ 'auth' ][ 'user' ]   = $username;
      $this->_proxy[ 'auth' ][ 'pass' ]   = $password;
      $this->_proxy[ 'auth' ][ 'meth' ] = $method;

      return $this;

   }
1316698
public function withBasicAuth(?string $username = null, string $password = null): self
    {
        if ($username === null) {
            return $this->withoutHeader('Authorization');
        } else {
            $auth = base64_encode($username . ':' . $password);

            return $this->withHeader('Authorization', "Basic {$auth}");
        }
    }
264794
public function setRandomPassword($username)
    {
        $password = false;

        /** @var UsersRepository $repo */
        $repo = $this->em->getRepository(Entity\Users::class);
        if ($userEntity = $repo->getUser($username)) {
            $password = $this->app['randomgenerator']->generateString(12);

            $userEntity->setPassword($password);
            $userEntity->setShadowpassword(null);
            $userEntity->setShadowtoken(null);
            $userEntity->setShadowvalidity(null);

            $this->em->getRepository(Entity\Users::class)->save($userEntity);

            $this->app['logger.system']->info(
                "Password for user '{$userEntity->getUsername()}' was reset via Nut.",
                ['event' => 'authentication']
            );
        }

        return $password;
    }
1076699
public function checkUserCredentials($username, $password)
    {
        return isset($this->userCredentials[$username]) && $this->userCredentials[$username] === $password;
    }
294278
public function authenticate($username, $password)
	{
		$this->debug->groupCollapsed(__METHOD__);
		$return = false;
		$users = $this->search(array(
			'username'	=> $username,
			'email'		=> $username,
		));
		if ($users && $this->verifyPassword($password, $users[0]['password'])) {
			$this->debug->info('login success');
			$this->log('login', $users[0]['userid']);
			$return = $users[0]['userid'];
		} else {
			$this->debug->warn('login failed');
			$userid = $users
				? $users[0]['userid']
				: null;
			$this->log('loginFail', $userid);
		}
		$this->debug->groupEnd();
		return $return;
	}
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);
        }
    }
862383
public function setup($userName, $password) {
        // we MUST have the username and password. No Blanks allowed!
        //
        // remove blanks else Empty doesn't work
        $userName = trim($userName);
        $password = trim($password);

        if (empty($userName) || empty($password)) {
            //Throw exception if the required parameters were not found
            $this->log('parameters did not include username and/or password');
            throw new RequiredParameterMissingException('One or more required parameters was not supplied. Both userName and password required!');
        }

        $this->userName = $userName;
        $this->password = $password;
    }
1369681
public function withCredentials($username, $password)
    {
        if (null === $username || null === $password) {
            // No change if credentials or null
            return $this;
        }

        $new = $this->setValue('username', $username)
            ->setValue('password', $password)
            ->setValue('credentials', [$username, $password]);

        // To keep BC
        $new->username = $username;
        $new->password = $password;
        $new->credentials = [$username, $password];

        return $new;
    }
1041525
public function login($username = 'anonymous', $password = '')
    {
        $result = $this->ftp->login($username, $password);

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

        return $this;
    }
833939
public function setCredentials(string $username, string $password)
    {
        $userpwd = $username . ':' . $password;
        curl_setopt($this->curl, CURLOPT_USERPWD, $userpwd);
    }
934189
public function login($username, $password)
    {
        $args = array($username, $password);
        $token = $this->_soapAdapter->call('login', $args);
        $this->setToken($token);
        return $token;
    }
176668
public function authenticate($username, $password)
    {
        try {
            $response = $this->client->adminInitiateAuth([
                'AuthFlow' => 'ADMIN_NO_SRP_AUTH',
                'AuthParameters' => [
                    'USERNAME' => $username,
                    'PASSWORD' => $password,
                    'SECRET_HASH' => $this->cognitoSecretHash($username),
                ],
                'ClientId' => $this->appClientId,
                'UserPoolId' => $this->userPoolId,
            ]);

            return $this->handleAuthenticateResponse($response->toArray());
        } catch (CognitoIdentityProviderException $e) {
            throw CognitoResponseException::createFromCognitoException($e);
        }
    }
490229
protected function authenticate(string $username, string $password)
    {
        if (!isset($this->users[$username]) || $this->users[$username]['password'] != $password) {
            return false;
        }

        return true;
    }
1230303
public function setBasicAuthentication($username, $password)
    {
        $this->basicAuthCredentials = implode(':', [$username, $password]);
        $this->curl->setBasicAuthentication($username, $password);
    }
649826
protected function _setSmtpAuthInfo($userName = null, $userPassword = null)
    {
        $this->set("SMTPAuth", true);
        $this->set("Username", $userName);
        $this->set("Password", $userPassword);
    }
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
        );
    }
368528
public function setBasicAuth( $username, $password )
	{
		$this->curl->setOption( CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
		$this->curl->setOption( CURLOPT_USERPWD, $username.":".$password );
	}