SimpleBrowser::authenticate PHP Method

authenticate() public method

Retries a request after setting the authentication for the current realm.
public authenticate ( string $username, string $password ) : boolean
$username string Username for realm.
$password string Password for realm.
return boolean True if successful fetch. Note that authentication may still have failed.
    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();
    }