class GuardAuthenticatorHandler
A utility class that does much of the work during the guard authentication process.
By having the logic here instead of the listener, more of the process can be called directly (e.g. for manual authentication) or overridden.
__construct(TokenStorageInterface $tokenStorage, EventDispatcherInterface $eventDispatcher = null, array $statelessProviderKeys = array()) | ||
authenticateWithToken(TokenInterface $token, Request $request) Authenticates the given token in the system. | ||
Response|null | handleAuthenticationSuccess(TokenInterface $token, Request $request, AuthenticatorInterface $guardAuthenticator, string $providerKey) Returns the "on success" response for the given GuardAuthenticator. | |
Response|null | authenticateUserAndHandleSuccess(UserInterface $user, Request $request, AuthenticatorInterface $authenticator, string $providerKey) Convenience method for authenticating the user and returning the Response if any for success. | |
Response|null | handleAuthenticationFailure(AuthenticationException $authenticationException, Request $request, AuthenticatorInterface $guardAuthenticator, string $providerKey) Handles an authentication failure and returns the Response for the GuardAuthenticator. | |
setSessionAuthenticationStrategy(SessionAuthenticationStrategyInterface $sessionStrategy) Call this method if your authentication token is stored to a session. |
TokenStorageInterface | $tokenStorage | |
EventDispatcherInterface | $eventDispatcher | |
array | $statelessProviderKeys |
Authenticates the given token in the system.
TokenInterface | $token | |
Request | $request |
Returns the "on success" response for the given GuardAuthenticator.
TokenInterface | $token | |
Request | $request | |
AuthenticatorInterface | $guardAuthenticator | |
string | $providerKey |
Response|null |
Convenience method for authenticating the user and returning the Response if any for success.
UserInterface | $user | |
Request | $request | |
AuthenticatorInterface | $authenticator | |
string | $providerKey |
Response|null |
Handles an authentication failure and returns the Response for the GuardAuthenticator.
AuthenticationException | $authenticationException | |
Request | $request | |
AuthenticatorInterface | $guardAuthenticator | |
string | $providerKey |
Response|null |
Call this method if your authentication token is stored to a session.
SessionAuthenticationStrategyInterface | $sessionStrategy |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Security/Guard/GuardAuthenticatorHandler.html