CheckPassportEvent.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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\Event;
  11. use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
  12. use Symfony\Component\Security\Http\Authenticator\Passport\PassportInterface;
  13. use Symfony\Contracts\EventDispatcher\Event;
  14. /**
  15. * This event is dispatched when the credentials have to be checked.
  16. *
  17. * Listeners to this event must validate the user and the
  18. * credentials (e.g. default listeners do password verification and
  19. * user checking)
  20. *
  21. * @author Wouter de Jong <wouter@wouterj.nl>
  22. */
  23. class CheckPassportEvent extends Event
  24. {
  25. private $authenticator;
  26. private $passport;
  27. public function __construct(AuthenticatorInterface $authenticator, PassportInterface $passport)
  28. {
  29. $this->authenticator = $authenticator;
  30. $this->passport = $passport;
  31. }
  32. public function getAuthenticator(): AuthenticatorInterface
  33. {
  34. return $this->authenticator;
  35. }
  36. public function getPassport(): PassportInterface
  37. {
  38. return $this->passport;
  39. }
  40. }