The logout page is responsible for terminating the user’s authentication session. This is a potentially complicated process and involves these steps:
When IdentityServer needs to show the logout page, it redirects the user to a configurable LogoutUrl.
builder.Services.AddIdentityServer(opt => {
opt.UserInteraction.LogoutUrl = "/path/to/logout";
})
If no LogoutUrl is set, IdentityServer will infer it from the LogoutPath of your Cookie Authentication Handler. For example:
builder.Services.AddAuthentication()
.AddCookie("cookie-handler-with-custom-path", options =>
{
options.LogoutPath = "/path/to/logout/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.LogoutPath = "/path/to/logout/for/aspnet_identity";
});