partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

NullEntryPoint.php (745B)


      1 <?php
      2 
      3 namespace PartKeepr\AuthBundle\Security\EntryPoint;
      4 
      5 use Symfony\Component\HttpFoundation\Request;
      6 use Symfony\Component\HttpFoundation\Response;
      7 use Symfony\Component\Security\Core\Exception\AuthenticationException;
      8 use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
      9 
     10 /**
     11  * Implements a NullEntryPoint to avoid that the user is being asked for their password in HTTP Basic Auth Scenarios.
     12  */
     13 class NullEntryPoint implements AuthenticationEntryPointInterface
     14 {
     15     /**
     16      * {@inheritdoc}
     17      */
     18     public function start(Request $request, AuthenticationException $authException = null)
     19     {
     20         $response = new Response();
     21         $response->setStatusCode(401);
     22 
     23         return $response;
     24     }
     25 }