8000 Why is security.authentication.success_handler abstract? · Issue #11926 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Why is security.authentication.success_handler abstract? #11926
Closed
@ftdysa

Description

@ftdysa

Why is this Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler class service definition declared as abstract? I am trying to decorate it with the following but am encountering the exception displayed below:

services:
    project.security.handler.login_success:
        public: false
        class: Project\WebBundle\Security\Authentication\Handler\LoginSuccessHandler
        decorates: security.authentication.simple_success_failure_handler
        arguments: ["@project.security.handler.login_success.inner", @project.manager.user]

This then throws:

RuntimeException: The definition "project.security.handler.login_success" has a reference to an abstract definition "project.security.handler.login_success.inner". Abstract definitions cannot be the target of references.

And here is the definition from the SecurityBundle

<service id="security.authentication.success_handler" class="%security.authentication.success_handler.class%" abstract="true" public="false">
    <argument type="service" id="security.http_utils" />
    <argument type="collection" /> <!-- Options -->
 </service>

My goal is to get the configured firewall map options (login_path, default_target_path, etc) in my own success handler. Is there a better way to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0