PHP 8.2.30
Preview: BasicAuthenticationEntryPoint.php Size: 1.11 KB
/opt/cloudlinux/alt-php55/root/usr/share/pear/Symfony/Component/Security/Http/EntryPoint/BasicAuthenticationEntryPoint.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Security\Http\EntryPoint;

use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;

/**
 * BasicAuthenticationEntryPoint starts an HTTP Basic authentication.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class BasicAuthenticationEntryPoint implements AuthenticationEntryPointInterface
{
    private $realmName;

    public function __construct($realmName)
    {
        $this->realmName = $realmName;
    }

    /**
     * {@inheritdoc}
     */
    public function start(Request $request, AuthenticationException $authException = null)
    {
        $response = new Response();
        $response->headers->set('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realmName));
        $response->setStatusCode(401);

        return $response;
    }
}

Directory Contents

Dirs: 0 × Files: 5

Name Size Perms Modified Actions
1.04 KB lrw-r--r-- 2019-12-18 11:24:07
Edit Download
1.11 KB lrw-r--r-- 2019-12-18 11:24:07
Edit Download
2.32 KB lrw-r--r-- 2019-12-18 11:24:07
Edit Download
2.01 KB lrw-r--r-- 2019-12-18 11:24:07
Edit Download
1.65 KB lrw-r--r-- 2019-12-18 11:24:07
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).