The login page is responsible for establishing the user’s authentication session. This requires a user to present credentials and typically involves these steps:
When IdentityServer needs to show the login page, it redirects the user to a configurable LoginUrl.
builder.Services.AddIdentityServer(opt => {
opt.UserInteraction.LoginUrl = "/path/to/login";
})
If no LoginUrl is set, IdentityServer will infer it from the LoginPath of your Cookie Authentication Handler. For example:
builder.Services.AddAuthentication()
.AddCookie("cookie-handler-with-custom-path", options =>
{
options.LoginPath = "/path/to/login/from/cookie/handler";
})
If you are using ASP.NET Identity, configure its cookie authentication handler like this:
builder.Services
.AddIdentityServer()
.AddAspNetIdentity<ApplicationUser>();
builder.Services
.ConfigureApplicationCookie(options =>
{
options.LoginPath = "/path/to/login/for/aspnet_identity";
});