This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/vendor/behat/mink/driver-testsuite/web-fixtures/basic_auth.php

13 lines
411 B
PHP

<?php
$username = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : false;
$password = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : false;
if ($username == 'mink-user' && $password == 'mink-password') {
echo 'is authenticated';
} else {
header('WWW-Authenticate: Basic realm="Mink Testing Area"');
header('HTTP/1.0 401 Unauthorized');
echo 'is not authenticated';
}