Symfony\Component\Security\Http\Firewall\AbstractAuthenticationListener
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.
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class AbstractAuthenticationListener
implements
ListenerInterface
{
- // members
- protected $options;
- protected $logger;
- protected $authenticationManager;
- protected $providerKey;
- protected $httpUtils;
- private $securityContext;
- private $sessionStrategy;
- private $dispatcher;
- private $successHandler;
- private $failureHandler;
- private $rememberMeServices;
- // methods
- public void __construct()
- public void setRememberMeServices()
- public final void handle()
- protected Boolean requiresAuthentication()
- protected abstract TokenInterface|Response|null attemptAuthentication()
- private void onFailure()
- private void onSuccess()
Hierarchy
Extended by
Implements
Members
private
- $dispatcher
- $failureHandler
- $rememberMeServices
- $securityContext
- $sessionStrategy
- $successHandler
protected
- $authenticationManager
- $httpUtils
- $logger
- $options
- $providerKey
Methods
private
protected
- attemptAuthentication() — Performs authentication.
- requiresAuthentication() — Whether this request requires authentication.
public
- __construct() — Constructor.
- handle() — Handles form based authentication.
- setRememberMeServices() — Sets the RememberMeServices implementation to use