PHP Класс Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener

Subclasses likely have to implement the following: - an TokenInterface to hold authentication related data - an AuthenticationProvider to perform the actual authentication of the token, retrieve the UserInterface implementation from a database, and perform the specific account checks using the UserChecker By default, this listener only is active for a specific path, e.g. login_check. If you want to change this behavior, you can overwrite the requiresAuthentication() method.
Автор: Fabien Potencier ([email protected])
Автор: Johannes M. Schmitt ([email protected])
Наследование: implements Symfony\Component\Security\Http\Firewall\ListenerInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$authenticationManager
$logger
$options
$providerKey

Открытые методы

Метод Описание
__construct ( Symfony\Component\Security\Core\SecurityContextInterface $securityContext, Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface $authenticationManager, Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, string $providerKey, array $options = [], Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface $successHandler = null, Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface $failureHandler = null, Symfony\Component\HttpKernel\Log\LoggerInterface $logger = null, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null ) Constructor.
handle ( GetResponseEvent $event ) Handles form based authentication.
setRememberMeServices ( Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface $rememberMeServices ) Sets the RememberMeServices implementation to use

Защищенные методы

Метод Описание
attemptAuthentication ( Request $request ) : Symfony\Component\Security\Core\Authentication\Token\TokenInterface Performs authentication.
requiresAuthentication ( Request $request ) : boolean Whether this request requires authentication.

Приватные методы

Метод Описание
determineTargetUrl ( Request $request ) : string Builds the target URL according to the defined options.
onFailure ( GetResponseEvent $event, Request $request, Symfony\Component\Security\Core\Exception\AuthenticationException $failed )
onSuccess ( GetResponseEvent $event, Request $request, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token )

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( Symfony\Component\Security\Core\SecurityContextInterface $securityContext, Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface $authenticationManager, Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, string $providerKey, array $options = [], Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface $successHandler = null, Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface $failureHandler = null, Symfony\Component\HttpKernel\Log\LoggerInterface $logger = null, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null )
$securityContext Symfony\Component\Security\Core\SecurityContextInterface A SecurityContext instance
$authenticationManager Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface An AuthenticationManagerInterface instance
$sessionStrategy Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface
$httpUtils Symfony\Component\Security\Http\HttpUtils An HttpUtilsInterface instance
$providerKey string
$options array An array of options for the processing of a successful, or failed authentication attempt
$successHandler Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface
$failureHandler Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface
$logger Symfony\Component\HttpKernel\Log\LoggerInterface A LoggerInterface instance
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface An EventDispatcherInterface instance

attemptAuthentication() абстрактный защищенный Метод

Performs authentication.
abstract protected attemptAuthentication ( Request $request ) : Symfony\Component\Security\Core\Authentication\Token\TokenInterface
$request Symfony\Component\HttpFoundation\Request A Request instance
Результат Symfony\Component\Security\Core\Authentication\Token\TokenInterface The authenticated token, or null if full authentication is not possible

handle() закрытый публичный Метод

Handles form based authentication.
final public handle ( GetResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseEvent A GetResponseEvent instance

requiresAuthentication() защищенный Метод

The default implementation only processed requests to a specific path, but a subclass could change this to only authenticate requests where a certain parameters is present.
protected requiresAuthentication ( Request $request ) : boolean
$request Symfony\Component\HttpFoundation\Request
Результат boolean

setRememberMeServices() публичный Метод

Sets the RememberMeServices implementation to use
public setRememberMeServices ( Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface $rememberMeServices )
$rememberMeServices Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface

Описание свойств

$authenticationManager защищенное свойство

protected $authenticationManager

$logger защищенное свойство

protected $logger

$options защищенное свойство

protected $options

$providerKey защищенное свойство

protected $providerKey