Spec-Zone.ru › Symfony 2.7

SimpleAuthenticationHandler

class SimpleAuthenticationHandler implements AuthenticationFailureHandlerInterface, AuthenticationSuccessHandlerInterface

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

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

Методы

__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.
http://api.symfony.com/2.7/Symfony/Component/Security/Http/Authentication/SimpleAuthenticationHandler.html

Spec-Zone.ru

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