作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我为 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>();
private static void SetupIdentityServer(IdentityServerOptions identityServerOptions)
{
identityServerOptions.UserInteraction.LoginUrl = "/Controller/Action";
}
关于.net-core - 如何为 IdentityServer4 配置登录 UI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42403288/
我是一名优秀的程序员,十分优秀!