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 !
Creating the quickstart IdentityServerStart by creating a new ASP.NET Core project. Then select the “Empty Web” option. IdentityServer currently only targets ASP.NET Core 1.1. IdentityServer uses the usual pattern to configure and add services to an ASP.NET Core host.
The new Duende IdentityServer continues to be open source, but now has a dual license. This license allows it to be used for free for development, testing, and learning, free for non-commercial open source, and free for use in commercial settings if the entity or organization makes less than 1 million USD/year.
In addition to the authentication cookie, IdentityServer will issue an additional cookie which defaults to the name “idsrv. session”. This cookie is derived from the main authentication cookie, and it used for the check session endpoint for browser-based JavaScript clients at signout time.
You can solve your problem by implementing Scaffolding.
Identity server doc says "Applications that include Identity can apply the scaffolder to selectively add the source code contained in the Identity Razor Class Library (RCL). You might want to generate source code so you can modify the code and change the behavior."
So you can change UI, end point and its behavior as your need.
Here is doc link
Just add the following in the Startup.cs
services.ConfigureApplicationCookie(config =>
{
config.Cookie.Name = "IdentityServer.Cookie";
config.LoginPath = "/Auth/Login";
config.LogoutPath = "/Auth/Logout";
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With