I'm using Identity. I used the Razor Pages template, which automatically installed the default Identity UI (Microsoft.AspNetCore.Identity.UI
).
I needed to customise various pages, so used the scaffolder tool (dotnet-aspnet-codegenerator
) to create those pages. I "disabled" the ones I didn't need.
At this point, is there any further purpose to the default UI, or can I remove it? Are there some dependencies within that I need even though I've scaffolded/customised pages of interest?
Removing the Microsoft.AspNetCore.Identity.UI is according to your actually requirement.
Without using this, you will not use the method AddDefaultIdentity which contains the default identity UI in program.cs. You should use AddIdentityCore or AddIdentity method.
This means, if you are using the scaffolder tool generated your required identity pages, you could remove it. If the page inside the Microsoft.AspNetCore.Identity.UI
is not generated inside your project, the identify will not redirect to that page just refresh current page.
Like below exmaple:
I just generate the login page, and use builder.Services.AddIdentity<IdentityUser,IdentityRole>(options => options.SignIn.RequireConfirmedAccount = true) .AddEntityFrameworkStores<ApplicationDbContext>();
, and when I click the register button inside the page(the link is not generated), it just keep current without redirecting the register page, since it doesn't exists.
Page: