How to use ASP.NET Core Identity UI with custom Authentication service instead Services.AddDefaultIdentity

Viewed 158

Microsoft.AspNetCore.Identity.UI.dll (net6.0) contains a series of useful pages

enter image description here

but any example uses default identity, something like that

 Builder.Services.AddDefaultIdentity(Of IdentityUser)(Sub(options) options.SignIn.RequireConfirmedAccount = True).AddEntityFrameworkStores(Of ApplicationDbContext)

This Identity based on IdentityUser (expanded from ApplicationUser) and EF memory buffers related to DB.

This way is not applicable to my project. I have Scoped service what can notify me - is password correct or not, what roles has current user and so on.

Can I use this Identity pages with my service UserService? Without definition of IdentityUser and EF (Of IdentityUser).
How I can initialize services in DI container for use IdentityUI and than simple use

    App.UseAuthentication()
    App.UseAuthorization()

Or IdentityUI don't applicable to custom user identification service at all?
And can I use UseAuthentication/UseAuthorization with my custom user identification service?

0 Answers
Related