Basic authentication
DrevOps\BehatSteps\Steps\Web\BasicAuthTrait - Source, Example, Helpers
Keep HTTP basic authentication applied across session resets.
- Re-apply the configured credentials before every scenario and step.
Mink resets the session before every scenario and on every fast logout, which clears request headers and drops the credentials. Without the re-application, a site behind webserver-level basic auth answers 401 mid-scenario.
The hooks are a no-op when no credentials are configured.
Skip with tag:@behat-steps-skip:BasicAuthTrait.
Options
| Option | Type | Default | Tag | Description |
|---|---|---|---|---|
basic_auth.enabled | boolean | TRUE | @behat-steps-skip:BasicAuthTrait | If TRUE, applies the user name and password in Mink's base_url, as in https://user:pass@example.com, to the browser session before each scenario and each step. If FALSE, those hooks don't apply them, though a logout and the detached HTTP client still send them. |