gpt4 book ai didi

.net-core - 如何为 IdentityServer4 配置登录 UI?

转载 作者:行者123 更新时间:2023-12-03 20:16:15 24 4
gpt4 key购买 nike

我为 IdentityServer4 找到的示例使用 MVC用于登录 UI。当 OpenIdConnect 隐式客户端点击“authorization_endpoint”(例如“http://localhost:5000/connect/authorize”)时,它会被重定向到 AccountController。登录 Action 。您将如何配置 IdentityServer4 以使用不同的 Controller 或 UI 作为登录页面?

最佳答案

在 ConfigureServices 方法下(在 Startup 中)添加一个 SetupIdentityServer 选项方法:

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

...其中 SetupIdentityServer 是可以设置登录 url 的方法的名称:
private static void SetupIdentityServer(IdentityServerOptions identityServerOptions)
{
identityServerOptions.UserInteraction.LoginUrl = "/Controller/Action";
}

关于.net-core - 如何为 IdentityServer4 配置登录 UI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42403288/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com