I am writing a service to handle AccessDeniedException and I found a way to solve it from Using Symfony2's AccessDeniedHandlerInterface
firewalls:
secured_area:
.....
access_denied_handler: kernel.listener.accessDenied.handler
And define the service here:
services:
kernel.listener.accessDenied.handler:
class: %kernel.listener.accessDenied.handler.class%
arguments: ["@service_container"]
tags:
- { name: 'kernel.event_listener', event: 'security.kernel_response', method: 'handle' }
But I dont know where I can find the definitions of these attributes for example event: 'security.kernel_response' . Where is the 'security.kernel_response' defined and where I can get the list of other events?
And for other handlers like 'access_denied_handler', how can I determine the tags for the corresponding services?
Debugging the Symfony container:
To debug the service container please use one of the following console commands
Current versions (> 2.7)
Show all registered services
List ordered by tags
Filtered by a single tag ( i.e. form.type )
and to include private services
Versions > 2.2 to < 2.7
Show all registered services
List ordered by tags
Filtered by a single tag ( i.e. form.type )
and to include private services
Versions < 2.2
To quickly find a service / tag (or tagged services on symfony2.<2) use grep ( linux, osx ) or findstr ( windows ) with a pipe like this:
or