How to customize the user interface for IdentityServer4?

The examples I find for IdentityServer4 use MVC for the login user interface. When an implicit OpenIdConnect client falls into "authorization_endpoint" (example http: // localhost: 5000 / connect / authorize '), it is redirected to the AccountController login action. How to configure IdentityServer4 to use a different controller or user interface as a login page?

+5
source share
1 answer

In the ConfigureServices method (in Startup), add the SetupIdentityServer parameter method:

services.AddIdentityServer(*SetupIdentityServer*) .AddSigningCredential(...) .AddValidationKeys() .AddConfigurationStore(builder => builder.UseSqlServer("")) .AddOperationalStore(builder => builder.UseSqlServer("")) .AddAspNetIdentity<ApplicationUser>(); 

... where SetupIdentityServer is the name of the method in which you can set the login URL:

 private static void SetupIdentityServer(IdentityServerOptions identityServerOptions) { identityServerOptions.UserInteraction.LoginUrl = "/Controller/Action"; } 
+12
source

Source: https://habr.com/ru/post/1264596/


All Articles