Search code examples
asp.net-identityidentityserver4blazorabp-framework

IdentityServer 4, how to add Custom Login page


I wish to customize the IdentityServer 4 and use custom pages for login / registration / lost password / etc... ( FYI, I use Blazor, but it should be the same ! ).

Example By example, for now, I use the following code:

Challenge(authProps, "oidc");

But it redirects to a pre-defined login page, how can I change this?

Information I have searched for some information, I have seen that some peoples use the following

.UserInteraction.LoginUrl = "http://..../MyLoginPage";

My problem is that I use abp.io, they provides an IdentityServer, but I have no access to the AddIdentityServer code, it is hardcoded somewhere and I have no access to it (AbpIdentityServerDomainModule.cs) !

So, I'm looking for a way to redefine the login page !


Solution

  • Just add the following in the Startup.cs

    services.ConfigureApplicationCookie(config =>
    {
        config.Cookie.Name = "IdentityServer.Cookie";
        config.LoginPath = "/Auth/Login";
        config.LogoutPath = "/Auth/Logout";
    });