Open jean-gui opened 5 years ago
well, passing $_SERVER
variables won't work with Panther, as it does not directly call PHP (it calls Selenium).
but Selenium supports passing the username and password of basic auth in the URL that you load, so you could use that way for the first URL you load on the domain (after that, the browser will remember the credentials until the end of the browsing session)
That seems complicated because there doesn't seem to be an easy way to get the base URL. All I can think about is:
$this->adminClient->get('/');
$baseUrl = $this->adminClient->getCurrentURL();
and then inject the username and password in $baseUrl
to make another request to get the browser to store credentials. Is this what you suggest?
As an alternative, would it be possible to set arbitrary request headers such as Authorization
?
It is possible to add credentials directly in the request url to bypass the prompt, exemple:
$client = static::createPantherClient();
$client->request('GET', 'https://login:password@mydomain.fr');
Hi,
With the WebTestCase client it's possible to use HTTP Basic Authentication using the following code:
It seems that PantherClient doesn't allow to do that, or the documentation for it is hard to find/missing.
I've tried asking on StackOverflow but with not much success: https://stackoverflow.com/questions/57908369/http-auth-with-panther.
Thanks