AuthenticationFailureHandlerInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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\Security\Core\Exception\AuthenticationException;
  12. use Symfony\Component\HttpFoundation\Request;
  13. /**
  14. * Interface for custom authentication failure handlers.
  15. *
  16. * If you want to customize the failure handling process, instead of
  17. * overwriting the respective listener globally, you can set a custom failure
  18. * handler which implements this interface.
  19. *
  20. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  21. */
  22. interface AuthenticationFailureHandlerInterface
  23. {
  24. /**
  25. * This is called when an interactive authentication attempt fails. This is
  26. * called by authentication listeners inheriting from
  27. * AbstractAuthenticationListener.
  28. *
  29. * @param Request $request
  30. * @param AuthenticationException $exception
  31. *
  32. * @return Response The response to return, never null
  33. */
  34. public function onAuthenticationFailure(Request $request, AuthenticationException $exception);
  35. }