Set a basic auth header.

@param string $username The username to use.
@param string $password The password to use.
329385
public function set_basic_auth($username, $password) {
		$value = 'Basic '.base64_encode($username.':'.$password);
		$this->set_header('Authorization', $value);
		return true;
	}
1042797
public function setProxyAuth($username, $password, $authType = CURLAUTH_BASIC)
    {
        if (!empty($username) && !empty($password)) {
            $this->proxyUsername = stripslashes(trim($username));
            $this->proxyPassword = stripslashes(trim($password));
            $this->proxyAuthType = intval($authType);
        }
    }
412160
public function setCredentials($username, $password)
    {
        $this->username = $username;
        $this->password = $password;
        $this->token = '';
        $this->accessToken = '';
        return $this;
    }
830215
public function login(string $username, string $password): void
    {
        $this->fillUsername($username);
        $this->fillPassword($password);
        $this->clickLogin();
    }
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;
    }
540169
public function setCredentials($username, $password)
    {
        $this->setCurlOption(CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
        $this->setCurlOption(CURLOPT_USERPWD, $username . ":" . $password);
    }
409556
public function setPassword($password = null)
    {
        if (empty($password)) {
            $password = $this->getEmptyPasswordSpecialty();
        }
        $phAttribute = $this->passwordHashAttribute;
        if (empty($phAttribute) || !is_string($phAttribute)) {
            return;
        }
        $this->$phAttribute = $this->generatePasswordHash($password);
        $this->_password = $password;
        $this->trigger(static::$eventAfterSetPassword);
    }
1165638
public function setAuthCredentials($username, $password)
    {

        $this->setUsername($username);

        $this->setPassword($password);

        $this->authCredentials = base64_encode(
            "{$this->username}:{$this->password}"
        );

    }
1039266
public function setPassword($password)
    {
        if (empty($password)) {
            $this->hashedPassword = null;
        } else {
            $this->hashedPassword = UsersManager::getPasswordHash($password);
        }
    }
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);
        }
    }
169018
public function setUsername($username, $password = null) {
		$this->username = (string) $username;
		
		if ($password !== null) {
			$this->setPassword($password);
		}
		
		return $this;
	}
315271
public void setUser(String userName, String password){
        if(userName != null && ! userName.isEmpty()){
            connection.setDirectoryUser(userName, password);
        }
    }
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;
    }
1249939
public function setDigestAuthentication($username = '', $password = '')
    {
        $this->digestAuthentication = [$username, $password, 'digest'];
        $this->debug->info(__FUNCTION__, 'setDigestAuthentication: ', $this->digestAuthentication);

        return $this;
    }
25364
public function auth( string $username = '', string $password = '', $method = \CURLAUTH_BASIC )
      : Request
   {

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

      return $this;

   }
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));
    }
1190852
public function authentication($username, $password)
    {
        $endpoint = sprintf('authentication?username=%s', urlencode($username));
        $parameters['value'] = $password;
        return $this->apiClient->callEndpoint(
            $endpoint,
            $parameters,
            null,
            HttpMethod::REQUEST_POST
        );
    }