abstract class AbstractAuthenticationListener implements ListenerInterface
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.
| protected | $options | ||
| protected | $logger | ||
| protected | $authenticationManager | ||
| protected | $providerKey | ||
| protected | $httpUtils |
| __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, string $providerKey, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, array $options = array(), LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null) | ||
| setRememberMeServices(RememberMeServicesInterface $rememberMeServices) Sets the RememberMeServices implementation to use. | ||
| handle(GetResponseEvent $event) Handles form based authentication. | ||
| bool | requiresAuthentication(Request $request) Whether this request requires authentication. | |
| TokenInterface|Response|null | attemptAuthentication(Request $request) Performs authentication. |
| TokenStorageInterface | $tokenStorage | |
| AuthenticationManagerInterface | $authenticationManager | |
| SessionAuthenticationStrategyInterface | $sessionStrategy | |
| HttpUtils | $httpUtils | |
| string | $providerKey | |
| AuthenticationSuccessHandlerInterface | $successHandler | |
| AuthenticationFailureHandlerInterface | $failureHandler | |
| array | $options | |
| LoggerInterface | $logger | |
| EventDispatcherInterface | $dispatcher |
| InvalidArgumentException |
Sets the RememberMeServices implementation to use.
| RememberMeServicesInterface | $rememberMeServices |
Handles form based authentication.
| GetResponseEvent | $event |
| RuntimeException | |
| SessionUnavailableException |
Whether this request requires authentication.
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.
| Request | $request |
| bool |
Performs authentication.
| Request | $request |
| TokenInterface|Response|null | The authenticated token, null if full authentication is not possible, or a Response |
| AuthenticationException | if the authentication fails |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.html