Set username and password
@param $username
@param $password
@throws \Exception
338536
public static function setUserDetails($username, $password, $class = null)
    {
        // Sanity check
        if (!isset($username) || is_null($username) || empty($username)) {
            throw new \Exception('Specificati un nume de utilizator valid');
        }
        if (!isset($password) || is_null($password) || empty($password)) {
            throw new \Exception('Specificati o parola valida');
        }

        // Set attributes
        self::$username = $username;
        self::$password = $password;
                
        if (is_null($class)) {
            $authProvider = new AuthProviderFile($username, $password);
        } else {
            $authProvider = new $class($username, $password);
            if (!($authProvider instanceof AuthProvider)) {
                throw new \Exception('Clasa specificata trebuie sa extinda celmarket\AuthProvider.');
            }
        }
        Dispatcher::setProvider($authProvider);
        $authProvider::checkToken();
    }
1144977
private function _login($username, $password) {
        $data["Envelope"] = array(
            "Body" => array(
                "Login" => array(
                    "USERNAME" => $username,
                    "PASSWORD" => $password,
                ),
            ),
        );
        $response = $this->_request($data);
        $result = $response["Envelope"]["Body"]["RESULT"];
        if ($this->_isSuccess($result)) {
            $this->_jsessionid = $result['SESSIONID'];
            $this->_session_encoding = $result['SESSION_ENCODING'];
            $this->_username = $username;
            $this->_password = $password;
        } else {
            throw new \Exception("Login Error: ".$this->_getErrorFromResponse($response));
        }
    }
833939
public function setCredentials(string $username, string $password)
    {
        $userpwd = $username . ':' . $password;
        curl_setopt($this->curl, CURLOPT_USERPWD, $userpwd);
    }
1098845
public function setAuth($username = null, $password = null)
    {
        $this->username = $username;
        $this->password = $password;
    }
301556
public function setAuth($username, $password)
    {
        if (strlen($username) > 255 || strlen($password) > 255) {
            throw new InvalidArgumentException('Both username and password MUST NOT exceed a length of 255 bytes each');
        }
        if ($this->protocolVersion !== null && $this->protocolVersion !== '5') {
            throw new UnexpectedValueException('Authentication requires SOCKS5. Consider using protocol version 5 or waive authentication');
        }
        $this->auth = pack('C2', 0x01, strlen($username)) . $username . pack('C', strlen($password)) . $password;
    }
864534
public function setUsername($username)
        {
            if ($this->validateUsername($username) === false) {
                throw new Exception("Username \"$username\" is not a valid HTTP username");
            }

            $oldUsername     = $this->_username;
            $this->_username = $username;

            return $oldUsername;
        }
820204
public function setUsername($username)
    {
      if(!is_string($username) && strlen(trim($username)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid username, must be a non empty string');

      $this->username = $username;
    }
18395
public function setCredentials(string $username, string $password): self
    {
        $this->bitFlag &= ~64;
        $this->bitFlag &= ~128;

        if ($username !== '') {
            $this->logger->debug('Username set, setting username flag');
            $this->bitFlag |= 128;
            $this->username = $username;
        }

        if ($password !== '') {
            $this->logger->debug('Password set, setting password flag');
            $this->bitFlag |= 64;
            $this->password = $password;
        }

        return $this;
    }
296763
public static function login($username, $password) {
		if ($user = user::find($username, $password)) {
			self::$user           = $user;
			self::$isGuest        = false;
			$_SESSION["username"] = $username;

			return true;
		}

		return false;
	}
1175131
public function setCredentials($username, $password)
    {
        $this->connectOptions['username'] = $username;
        $this->connectOptions['password'] = $password;
        
        return $this;
    }
413395
protected function fireAttemptingEvent($username, $password)
    {
        if (isset($this->events)) {
            $this->events->fire(new Attempting($this->connection, $username, $password));
        }
    }
907506
public function setAuthentication($username, $password)
    {
        $this->_mailer->Username = $username;
        $this->_mailer->Password = $password;

        return $this;
    }
892064
public function authCredentials(string $username, string $password): self
    {
        $this->username = $username;
        $this->password = $password;
        return $this;
    }
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);
        }
    }
1177340
public function setAuthCredentials($username, $password)
    {
        trigger_error('setAuthCredentials is deprecated. Use setAuth with proper authentifier', E_USER_DEPRECATED);
        $this->setAuth(new Authentication\LoginPasswordAuth($username, $password));
    }
412160
public function setCredentials($username, $password)
    {
        $this->username = $username;
        $this->password = $password;
        $this->token = '';
        $this->accessToken = '';
        return $this;
    }
465737
public function setAuth($username, $password)
    {
        $this->connectionOptions[CURLOPT_USERPWD] = $username . ':' . $password;
        $this->connectionOptions[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC;
        return $this;
    }