browser.php
public function authenticate($username, $password)
    {
        if (! $this->page->getRealm()) {
            return false;
        }
        $url = $this->page->getUrl();
        if (! $url) {
            return false;
        }
        $this->user_agent->setIdentity(
                $url->getHost(),
                $this->page->getRealm(),
                $username,
                $password);

        return $this->retry();
    }
public function authenticate($username, $password)
    {
        if (! $this->page->getRealm()) {
            return false;
        }
        $url = $this->page->getUrl();
        if (! $url) {
            return false;
        }
        $this->user_agent->setIdentity(
                $url->getHost(),
                $this->page->getRealm(),
                $username,
                $password);

        return $this->retry();
    }
Retries a request after setting the authentication for the current realm.

@param string $username    Username for realm.
@param string $password    Password for realm.

@return bool    True if successful fetch. Note that authentication may still have failed.