Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Configure login UI for IdentityServer4?

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?

like image 496
William Lohan Avatar asked Feb 22 '17 22:02

William Lohan


People also ask

How do I log into my identity server?

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.

Is IdentityServer4 obsolete?

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.

What is Identity Server authentication?

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.


1 Answers

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";
}
like image 106
travis.js Avatar answered Nov 03 '22 18:11

travis.js