SimpleAuthenticationHandler

SimpleAuthenticationHandler

class SimpleAuthenticationHandler implements AuthenticationFailureHandlerInterface, AuthenticationSuccessHandlerInterface

Class to proxy authentication success/failure handlers.

Events are sent to the SimpleAuthenticatorInterface if it implements the right interface, otherwise (or if it fails to return a Response) the default handlers are triggered.

Methods

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

Constructor.

Response onAuthenticationSuccess(Request $request, TokenInterface $token)

This is called when an interactive authentication attempt succeeds. This is called by authentication listeners inheriting from AbstractAuthenticationListener.

Response onAuthenticationFailure(Request $request, AuthenticationException $exception)

This is called when an interactive authentication attempt fails. This is called by authentication listeners inheriting from AbstractAuthenticationListener.

Details

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

Constructor.

Parameters

SimpleAuthenticatorInterface $authenticator SimpleAuthenticatorInterface instance
AuthenticationSuccessHandlerInterface $successHandler Default success handler
AuthenticationFailureHandlerInterface $failureHandler Default failure handler
LoggerInterface $logger Optional logger

Response onAuthenticationSuccess(Request $request, TokenInterface $token)

This is called when an interactive authentication attempt succeeds. This is called by authentication listeners inheriting from AbstractAuthenticationListener.

Parameters

Request $request
TokenInterface $token

Return Value

Response never null

Response onAuthenticationFailure(Request $request, AuthenticationException $exception)

This is called when an interactive authentication attempt fails. This is called by authentication listeners inheriting from AbstractAuthenticationListener.

Parameters

Request $request
AuthenticationException $exception

Return Value

Response The response to return, never null
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部