Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

SSO in Blazor 8 - no entry in AspNetUserLogins is written

$
0
0

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.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>