mediatekformation

AbstractAuthenticationListener extends AbstractListener
in package
implements ListenerInterface Uses LegacyListenerTrait

The AbstractAuthenticationListener is the preferred base class for all browser-/HTTP-based authentication requests.

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.

Tags
author

Fabien Potencier fabien@symfony.com

author

Johannes M. Schmitt schmittjoh@gmail.com

Interfaces, Classes, Traits and Enums

ListenerInterface
Interface that must be implemented by firewall listeners.

Table of Contents

$authenticationManager  : mixed
$httpUtils  : mixed
$logger  : mixed
$options  : mixed
$providerKey  : mixed
$dispatcher  : mixed
$failureHandler  : mixed
$rememberMeServices  : mixed
$sessionStrategy  : mixed
$successHandler  : mixed
$tokenStorage  : mixed
__construct()  : mixed
__invoke()  : mixed
authenticate()  : mixed
Handles form based authentication.
setRememberMeServices()  : mixed
Sets the RememberMeServices implementation to use.
supports()  : bool|null
Tells whether the authenticate() method should be called or not depending on the incoming request.
attemptAuthentication()  : TokenInterface|Response|null
Performs authentication.
requiresAuthentication()  : bool
Whether this request requires authentication.
onFailure()  : Response
onSuccess()  : Response

Properties

Methods

__construct()

public __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, string $providerKey, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler[, array<string|int, mixed> $options = [] ][, LoggerInterface $logger = null ][, EventDispatcherInterface $dispatcher = null ]) : mixed
Parameters
$tokenStorage : TokenStorageInterface
$authenticationManager : AuthenticationManagerInterface
$sessionStrategy : SessionAuthenticationStrategyInterface
$httpUtils : HttpUtils
$providerKey : string
$successHandler : AuthenticationSuccessHandlerInterface
$failureHandler : AuthenticationFailureHandlerInterface
$options : array<string|int, mixed> = []
$logger : LoggerInterface = null
$dispatcher : EventDispatcherInterface = null
Tags
throws
InvalidArgumentException
Return values
mixed

supports()

Tells whether the authenticate() method should be called or not depending on the incoming request.

public supports(Request $request) : bool|null
Parameters
$request : Request
Return values
bool|null

requiresAuthentication()

Whether this request requires authentication.

protected requiresAuthentication(Request $request) : bool

The default implementation only processes requests to a specific path, but a subclass could change this to only authenticate requests where a certain parameters is present.

Parameters
$request : Request
Return values
bool

Search results