Spec-Zone.ru › Symfony 4.1

GuardAuthenticatorHandler

class GuardAuthenticatorHandler

Класс-утилита, выполняющий большую часть работы во время процесса аутентификации с помощью защиты.

Перемещение логики в этот класс вместо слушателя позволяет вызывать больше этапов процесса напрямую (например, для ручного аутентификации) или переопределять их.

Методы

__construct(TokenStorageInterface $tokenStorage, EventDispatcherInterface $eventDispatcher = null, array $statelessProviderKeys = array())
authenticateWithToken(TokenInterface $token, Request $request)

Аутентифицирует данный токен в системе.

Response|null handleAuthenticationSuccess(TokenInterface $token, Request $request, AuthenticatorInterface $guardAuthenticator, string $providerKey)

Возвращает ответ "при успехе" для данного GuardAuthenticator.

Response|null authenticateUserAndHandleSuccess(UserInterface $user, Request $request, AuthenticatorInterface $authenticator, string $providerKey)

Удобный метод для аутентификации пользователя и возвращения ответа (если есть) при успехе.

Response|null handleAuthenticationFailure(AuthenticationException $authenticationException, Request $request, AuthenticatorInterface $guardAuthenticator, string $providerKey)

Обрабатывает ошибку аутентификации и возвращает ответ для GuardAuthenticator.

setSessionAuthenticationStrategy(SessionAuthenticationStrategyInterface $sessionStrategy)

Вызовите этот метод, если ваш токен аутентификации хранится в сессии.

Подробности

__construct(TokenStorageInterface $tokenStorage, EventDispatcherInterface $eventDispatcher = null, array $statelessProviderKeys = array())

Параметры

TokenStorageInterface $tokenStorage
EventDispatcherInterface $eventDispatcher
array $statelessProviderKeys

authenticateWithToken(TokenInterface $token, Request $request)

Аутентифицирует данный токен в системе.

Параметры

TokenInterface $token
Request $request

Response|null handleAuthenticationSuccess(TokenInterface $token, Request $request, AuthenticatorInterface $guardAuthenticator, string $providerKey)

Возвращает ответ "при успехе" для данного GuardAuthenticator.

Параметры

TokenInterface $token
Request $request
AuthenticatorInterface $guardAuthenticator
string $providerKey

Возвращаемое значение

Response|null

Response|null authenticateUserAndHandleSuccess(UserInterface $user, Request $request, AuthenticatorInterface $authenticator, string $providerKey)

Удобный метод для аутентификации пользователя и возвращения ответа (если есть) при успехе.

Параметры

UserInterface $user
Request $request
AuthenticatorInterface $authenticator
string $providerKey

Возвращаемое значение

Response|null

Response|null handleAuthenticationFailure(AuthenticationException $authenticationException, Request $request, AuthenticatorInterface $guardAuthenticator, string $providerKey)

Обрабатывает ошибку аутентификации и возвращает ответ для GuardAuthenticator.

Параметры

AuthenticationException $authenticationException
Request $request
AuthenticatorInterface $guardAuthenticator
string $providerKey

Возвращаемое значение

Response|null

setSessionAuthenticationStrategy(SessionAuthenticationStrategyInterface $sessionStrategy)

Вызовите этот метод, если ваш токен аутентификации хранится в сессии.

Параметры

SessionAuthenticationStrategyInterface $sessionStrategy

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Security/Guard/GuardAuthenticatorHandler.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API