Symfony 2: Security Configuration: Entry and Exit Handlers

Using Symfony 2, I am looking for additional information about handlers that you can define in the security configuration file app/config/security.yml( official documentation ). The documentation does not contain any information about the handlers. Here is a snippet of the security file:

# app/config/security.yml

security:        
    ...

    firewalls:                            
            somename:

                form_login:
                    ...

                    # login failure redirecting options (read further below)
                    failure_path:    /foo
                    failure_forward: false
                    failure_path_parameter: _failure_path
                    failure_handler: some.service.id
                    success_handler: some.service.id


                logout:
                    path:   /logout
                    target: /
                    invalidate_session: false
                    delete_cookies:
                        a: { path: null, domain: null }
                        b: { path: null, domain: null }
                    handlers: [some.service.id, another.service.id]
                    success_handler: some.service.id
                anonymous: ~

There is a field in both parts of form_login ang logout success_handler. In addition, for the output part, you can define several handlers using the field handlers.

I have two questions:

  • If I define a service succes_handler(using, for example, AuthenticationSuccessHandlerInterface or LogoutHandlerInterface), will it override the default success handler provided within the framework?

  • , handlers?

+4
2

app/config/security.yml:

handlers: [some.service.id, another.service.id] = > , Symfony\Component\Security\Http\Logout\LogoutHandlerInterface. . , - .

success_handler: some.service.id = > = > Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface. . Symfony\Component\Security\Http\Firewall\LogoutListener ( ).

+5

All Articles