Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancing Authentication Integration in SonataAdminBundle with Symfony Security #441

Open
ec-ecss opened this issue Mar 31, 2024 · 0 comments

Comments

@ec-ecss
Copy link

ec-ecss commented Mar 31, 2024

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant