Basic Authentication with Dusk

Posted 3 months ago by Continuum

I'd like to run Dusk tests on a remote site that is behind basic auth (.htaccess) - The browser will pop-up a browser-level dialog that asks for the authentication details.

After a search on SO, I see the suggested course of action is to do: $browser->visit('http://username:[email protected]'); 'username' and 'password' in this instance, are correct for a working username and password, however, my tests are failing, and the screenshot shows a 401 - authorization required.

Is Dusk able to authenticate in this way ? Is there another work-around without having to disable the htaccess on the protected URL ?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.