2 $SERVER = $app['request']->server->all();
4 $username = isset($SERVER['PHP_AUTH_USER']) ? $SERVER['PHP_AUTH_USER'] : false;
5 $password = isset($SERVER['PHP_AUTH_PW']) ? $SERVER['PHP_AUTH_PW'] : false;
7 if ($username == 'mink-user' && $password == 'mink-password') {
8 echo 'is authenticated';
10 $resp = new \Symfony\Component\HttpFoundation\Response();
11 $resp->setStatusCode(401);
12 $resp->headers->set('WWW-Authenticate', 'Basic realm="Mink Testing Area"');
14 echo 'is not authenticated';