AuthenticationFailureEvent.php 977 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\Core\Event;
  11. use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
  12. use Symfony\Component\Security\Core\Exception\AuthenticationException;
  13. /**
  14. * This event is dispatched on authentication failure.
  15. *
  16. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  17. */
  18. final class AuthenticationFailureEvent extends AuthenticationEvent
  19. {
  20. private $authenticationException;
  21. public function __construct(TokenInterface $token, AuthenticationException $ex)
  22. {
  23. parent::__construct($token);
  24. $this->authenticationException = $ex;
  25. }
  26. public function getAuthenticationException(): AuthenticationException
  27. {
  28. return $this->authenticationException;
  29. }
  30. }