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 ?