Spec-Zone.ru › Symfony 4.1

SimpleAuthenticationHandler

class SimpleAuthenticationHandler implements AuthenticationFailureHandlerInterface, AuthenticationSuccessHandlerInterface

Класс для делегирования обработчиков успешного/неуспешного авторизации.

События отправляются в SimpleAuthenticatorInterface, если он реализует соответствующий интерфейс, в противном случае (или если он не возвращает Response) вызываются стандартные обработчики.

Свойства

protected $successHandler
protected $failureHandler
protected $simpleAuthenticator
protected $logger

Методы

__construct(SimpleAuthenticatorInterface $authenticator, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, LoggerInterface $logger = null)
Response onAuthenticationSuccess(Request $request, TokenInterface $token)

Вызывается при успешной попытке интерактивной авторизации. Вызывается слушателями авторизации, наследующими от AbstractAuthenticationListener.

Response onAuthenticationFailure(Request $request, AuthenticationException $exception)

Вызывается при неудачной попытке интерактивной авторизации. Вызывается слушателями авторизации, наследующими от AbstractAuthenticationListener.

Подробности

__construct(SimpleAuthenticatorInterface $authenticator, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, LoggerInterface $logger = null)

Параметры

SimpleAuthenticatorInterface $authenticator Экземпляр SimpleAuthenticatorInterface
AuthenticationSuccessHandlerInterface $successHandler Обработчик успешной авторизации по умолчанию
AuthenticationFailureHandlerInterface $failureHandler Обработчик неуспешной авторизации по умолчанию
LoggerInterface $logger Дополнительный логгер

Response onAuthenticationSuccess(Request $request, TokenInterface $token)

Вызывается при успешной попытке интерактивной авторизации. Вызывается слушателями авторизации, наследующими от AbstractAuthenticationListener.

Параметры

Request $request
TokenInterface $token

Значение результата

Response никогда не null

Response onAuthenticationFailure(Request $request, AuthenticationException $exception)

Вызывается при неудачной попытке интерактивной авторизации. Вызывается слушателями авторизации, наследующими от AbstractAuthenticationListener.

Параметры

Request $request
AuthenticationException $exception

Значение результата

Response Возвращаемый ответ, никогда не null

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

Spec-Zone.ru

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