我发现的IdentityServer4示例使用MVC作为登录UI。当OpenIdConnect隐式客户端点击'authorization_endpoint‘(例如'http://localhost:5000/connect/authorize')时,它会被重定向到AccountController登录操作。如何将IdentityServer4配置为使用不同的控制器或UI作为登录页面?
发布于 2017-02-23 08:11:01
在ConfigureServices方法(在启动中)下,添加SetupIdentityServer options方法:
services.AddIdentityServer(*SetupIdentityServer*)
.AddSigningCredential(...)
.AddValidationKeys()
.AddConfigurationStore(builder => builder.UseSqlServer(""))
.AddOperationalStore(builder => builder.UseSqlServer(""))
.AddAspNetIdentity<ApplicationUser>();...where SetupIdentityServer是可用于设置登录url的方法的名称:
private static void SetupIdentityServer(IdentityServerOptions identityServerOptions)
{
identityServerOptions.UserInteraction.LoginUrl = "/Controller/Action";
}https://stackoverflow.com/questions/42403288
复制相似问题