I have a Blazor web app on .NET 8 with Identity Framework. I want to use SSO with Microsoft and therefore I configured:
builder.Services.AddAuthentication() .AddMicrosoftAccount(microsoftOptions => { microsoftOptions.ClientId = builder.Configuration["MicrosoftClientID"]; microsoftOptions.ClientSecret = builder.Configuration["MicrosoftClientSecret"]; });in my program.cs. On the Login page, the Microsoft button appears. When I click it, I get redirected to Microsoft and end up in ExternalLogin OnLoginCallbackAsync().
SignInManager.GetExternalLoginInfoAsync() delivers the correct information, the user and a provider key.
As far as I understood, this information should be stored in AspNetUserLogins, but this table stays empty. Therefore ExternalLoginSignInAsync returns "failed".
I guess the entry in AspNetUserLogins should be written in Account/PerformExternalLogin but I am not able to scaffold this or debug it.
Has anyone any Idea on this?
In Blazor on .NET 7, this worked just fine.