Search code examples
authenticationblazorblazor-server-sidedapper.net-8.0

Blazor Net 8.0 Custom Authentication Not Working


I am trying to create my own Identity Model and Store using dapper.

But I am getting this error enter image description here

Here is my sample code. Note I am using my custom MyIdentityUser and custom AddDapperStores.

builder.Services.AddIdentityCore<MyIdentityUser>(options => options.SignIn.RequireConfirmedAccount = true)
    .AddDapperStores()
    .AddSignInManager()
    .AddDefaultTokenProviders();

I have tried this custom MyIdentityUser and AddDapperStores in Blazor NET 6.0; it works perfectly.


Solution

  • I finally found my problem..

    In .NET 8 somehow the template includes a lot of extension and page for authentication. To solve it..I need to change all the codes under the folder Components/Account.

    thanks all..