Skip to content

Add documentation for form_login handlers #6493

Closed
@samsch

Description

@samsch

In the security reference, under form_login there are success_handler and failure_handler keys which can be set to services. There doesn't seem to by any other documentation about this functionality.

What needs to be documented:

  • What interfaces to implement (AuthenticationSuccessHandlerInterface, AuthenticationFailureHandlerInterface)
  • When these handlers are called (immediately after login success, I assume)
  • Whether there is a default (yes), and whether you are replacing this default or adding an additional listener (replacing, I think)
  • Basic example of usage

My basic example of usage is to add a cookie to the default redirect response. To do this, I extend the DefaultAuthenticationSuccessHandler, override onAuthenticationSuccess to call the parent and get the response, modify the response, and return it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions