Examples I find for IdentityServer4 use MVC for login UI. When a OpenIdConnect implicit client hits the 'authorization_endpoint' (example 'http://localhost:5000/connect/authorize') it gets redirected to the AccountController Login action. How would you configure IdentityServer4 to use a different controller or UI for as the login page?
Login WorkflowYou must inform IdentityServer of the path to your login page via the UserInteraction settings on the options (the default is /account/login ). A returnUrl parameter will be passed informing your login page where the user should be redirected once login is complete.
IdentityServer4 support will last until the end of life of . NET Core 3.1 that means till November 2022. In that way, Duende provides new documentation for the fifth service version.
IdentityServer is an authentication server that implements OpenID Connect (OIDC) and OAuth 2.0 standards for ASP.NET Core. It's designed to provide a common way to authenticate requests to all of your applications, whether they're web, native, mobile, or API endpoints.
Under the ConfigureServices method (in Startup) add in a SetupIdentityServer options method:
services.AddIdentityServer(*SetupIdentityServer*)
.AddSigningCredential(...)
.AddValidationKeys()
.AddConfigurationStore(builder => builder.UseSqlServer(""))
.AddOperationalStore(builder => builder.UseSqlServer(""))
.AddAspNetIdentity<ApplicationUser>();
...where SetupIdentityServer is the name of a method where you can set the login url:
private static void SetupIdentityServer(IdentityServerOptions identityServerOptions)
{
identityServerOptions.UserInteraction.LoginUrl = "/Controller/Action";
}
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