AuthenticatorManagerInterface.php 1022 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Security\Http\Authentication;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\HttpFoundation\Response;
  13. use Symfony\Component\Security\Http\Firewall\FirewallListenerInterface;
  14. /**
  15. * @author Wouter de Jong <wouter@wouterj.nl>
  16. * @author Ryan Weaver <ryan@symfonycasts.com>
  17. *
  18. * @experimental in 5.2
  19. */
  20. interface AuthenticatorManagerInterface
  21. {
  22. /**
  23. * Called to see if authentication should be attempted on this request.
  24. *
  25. * @see FirewallListenerInterface::supports()
  26. */
  27. public function supports(Request $request): ?bool;
  28. /**
  29. * Tries to authenticate the request and returns a response - if any authenticator set one.
  30. */
  31. public function authenticateRequest(Request $request): ?Response;
  32. }