Skip to content

Enhancing Authentication Integration in SonataAdminBundle with Symfony Security #441

@ec-ecss

Description

@ec-ecss

Not sure if it's on the symfony or knpuniversity responsability....
When I want to authentificate from oauth to sonata-admin-with-user-bundle,
I need to add this ugly code on the Authentificator... (lost horrible time to debug this... )

//  ....
    public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response
    {
        $session = $request->getSession();
        $session->set('_security_user', serialize($token));
        $session->save();
        //.......

If not, the session after the badge is not set on the "user" firewall, but "main".

So if auth seems to work on the current request due to the badge, the next request within the session will not survive on the wrong firewall.

Could your bundle be enhanced to avoid 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