I found the problem: i was previously using a CustomAuthenticationStateProvider and i forgot to remove it from the application builder:
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthenticationStateProvider>();
This is overwriting, as inteded i guess, any other state coming from a different authentication flow.