Compone un header de autenticación WSSE.
@param string $username
@param string $password
@see http://en.wikipedia.org/wiki/WS-Security
975856
public static function buildWsseHeader($username, $password)
    {
        $nonce = mt_rand();
        $date = new \DateTime();
        $createdAt = $date->format("c");
        $passwordDigest = base64_encode(sha1(
            base64_decode($nonce) . $createdAt . $password,
            TRUE
        ));
        $wsseCredentials = sprintf(
            static::WSSE_CREDENTIALS_PATTERN,
            $username,
            $passwordDigest,
            $nonce,
            $createdAt
        );

        return $wsseCredentials;
    }
634913
public function userPwd($username, $password)
    {
        $this->username = $username;
        $this->password = $password;
        return $this;
    }
665951
public function setup(string $host, string $username, string $password, string $security, bool $use_smtp = true): void
    {
        $this->use_smtp = $use_smtp;
        $this->email_host = $host;
        $this->email_username = $username;
        $this->email_password = $password;
        $this->email_security = $security;
    }
892064
public function authCredentials(string $username, string $password): self
    {
        $this->username = $username;
        $this->password = $password;
        return $this;
    }
526529
public function withCredentials($username, $password)
	{
		$this->cookie = null;
		$this->credentials = array('username' => $username, 'password' => $password);
		return $this;
	}
18792
protected function acquireSecurityTokenFromFederatedSTS($username, $password) {

        $response = Requests::get(str_replace('{username}', $username, self::$RealmUrlTemplate),null);
        $federatedStsUrl = $this->getFederatedAuthenticationInformation($response);

        if ($federatedStsUrl) {
          $message_id = md5(uniqid($username . '-' . time() . '-' . rand() , true));
          $data = $this->prepareSecurityFederatedTokenRequest($username, $password, $message_id, $federatedStsUrl->textContent);

          $headers = array();
          $headers['Content-Type'] = 'application/soap+xml';
          $response = Requests::post($federatedStsUrl->textContent, $headers, $data);

          $samlAssertion = $this->getSamlAssertion($response);

          if ($samlAssertion) {
            $samlAssertion_node = $samlAssertion->item(0);
            $data = $this->prepareRST2Request($samlAssertion_node);
            $response = Requests::post(self::$RST2Url, $headers, $data);
            $this->usingFederatedSTS = TRUE;

            return $response;
          }
        }

        return NULL;
    }
694869
public function basicAuth($username, $password)
    {
        $this->auth = new BasicAuth($username, $password);
        return $this->auth;
    }
562472
public function setHttpBasicAuth($domain, $username, $password) {
        $this->requireOpenConnection();
        $this->requireFeature('authBasic');

        $response = $this->curl(
            'PUT',
            '/proxy/' . $this->port . '/auth/basic/' . urlencode($domain),
            array(
                'username' => $username,
                'password' => $password
            )
        );
    }
329385
public function set_basic_auth($username, $password) {
		$value = 'Basic '.base64_encode($username.':'.$password);
		$this->set_header('Authorization', $value);
		return true;
	}
406210
protected function fireBindingEvent($username, $password)
    {
        if (isset($this->events)) {
            $this->events->fire(new Binding($this->connection, $username, $password));
        }
    }
490229
protected function authenticate(string $username, string $password)
    {
        if (!isset($this->users[$username]) || $this->users[$username]['password'] != $password) {
            return false;
        }

        return true;
    }
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;
    }
917161
public function setBasicAuth($username, $password)
    {
        $this->username = $username;
        $this->password = $password;

        return $this;
    }
490428
public function connect($username, $password)
    {
        $error = parent::connect($username, $password);

        if ($error) {
            return $error;
        }

        return $this->load_script();
    }
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;
    }
230723
public function write($username, $password) {
        $time = time();

        $cookie = array();
        $cookie['username'] = base64_encode($username);
        $cookie['password'] = base64_encode($password);
        $cookie['hash'] = $this->Auth->password($username . $time);
        $cookie['time'] = $time;

        if (env('REMOTE_ADDR') === '127.0.0.1' || env('HTTP_HOST') === 'localhost') {
            $this->Cookie->domain = $this->cookieLocalDomain;
        }

        $this->Cookie->write($this->cookieName, $cookie, true, $this->expires);
        $this->debug('cookieSet', $cookie, $this->Auth->user());
    }
228898
public function setAuth($username, $password)
    {
        if (!empty($username) && !empty($password)) {
            $this->username = stripslashes(trim($username));
            $this->password = stripslashes(trim($password));
        }
    }