W3cubDocs

/Symfony 2.7

Symfony\Component\Security\Http\Firewall\ExceptionListener

class ExceptionListener

ExceptionListener catches authentication exception and converts them to Response instances.

Methods

__construct(SecurityContextInterface $context, AuthenticationTrustResolverInterface $trustResolver, HttpUtils $httpUtils, $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint = null, $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null, LoggerInterface $logger = null)
register(EventDispatcherInterface $dispatcher)

Registers a onKernelException listener to take care of security exceptions.

unregister(EventDispatcherInterface $dispatcher)

Unregisters the dispatcher.

onKernelException(GetResponseForExceptionEvent $event)

Handles security related exceptions.

Details

public __construct(SecurityContextInterface $context, AuthenticationTrustResolverInterface $trustResolver, HttpUtils $httpUtils, $providerKey, AuthenticationEntryPointInterface $authenticationEntryPoint = null, $errorPage = null, AccessDeniedHandlerInterface $accessDeniedHandler = null, LoggerInterface $logger = null)

Parameters

SecurityContextInterface $context
AuthenticationTrustResolverInterface $trustResolver
HttpUtils $httpUtils
$providerKey
AuthenticationEntryPointInterface $authenticationEntryPoint
$errorPage
AccessDeniedHandlerInterface $accessDeniedHandler
LoggerInterface $logger

public register(EventDispatcherInterface $dispatcher)

Registers a onKernelException listener to take care of security exceptions.

Parameters

EventDispatcherInterface $dispatcher An EventDispatcherInterface instance

public unregister(EventDispatcherInterface $dispatcher)

Unregisters the dispatcher.

Parameters

EventDispatcherInterface $dispatcher An EventDispatcherInterface instance

public onKernelException(GetResponseForExceptionEvent $event)

Handles security related exceptions.

Parameters

GetResponseForExceptionEvent $event An GetResponseForExceptionEvent instance

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/Security/Http/Firewall/ExceptionListener.html