首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何配置IdentityServer4的登录界面?

如何配置IdentityServer4的登录界面?
EN

Stack Overflow用户
提问于 2017-02-23 06:13:39
回答 1查看 6.9K关注 0票数 17

我发现的IdentityServer4示例使用MVC作为登录UI。当OpenIdConnect隐式客户端点击'authorization_endpoint‘(例如'http://localhost:5000/connect/authorize')时,它会被重定向到AccountController登录操作。如何将IdentityServer4配置为使用不同的控制器或UI作为登录页面?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-02-23 08:11:01

在ConfigureServices方法(在启动中)下,添加SetupIdentityServer options方法:

代码语言:javascript
复制
services.AddIdentityServer(*SetupIdentityServer*)
        .AddSigningCredential(...)
        .AddValidationKeys()
        .AddConfigurationStore(builder => builder.UseSqlServer(""))
        .AddOperationalStore(builder => builder.UseSqlServer(""))
        .AddAspNetIdentity<ApplicationUser>();

...where SetupIdentityServer是可用于设置登录url的方法的名称:

代码语言:javascript
复制
private static void SetupIdentityServer(IdentityServerOptions identityServerOptions)
{
    identityServerOptions.UserInteraction.LoginUrl = "/Controller/Action";
}
票数 30
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42403288

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档