IdentityServer未显示自定义视图

时间:2016-05-03 19:42:58

标签: identityserver3

我尝试通过在我的网络应用程序的根目录中添加login.html文件夹并在其中放置https://localhost:44343/identity来遵循本指南https://identityserver.github.io/Documentation/docs/advanced/customizingViews.html

然而,当导航将我带到{{1}}时,我看到的登录页面仍然是默认页面。

我做错了什么,为什么不选择被覆盖的登录页面?我正在使用IdentityServer3 2.5.0。

1 个答案:

答案 0 :(得分:4)

找到解决方案:

当我使用IdentityServerServiceFactory时,我需要配置默认视图服务以查看/Assets文件夹:

var factory = new IdentityServerServiceFactory();

// more code...

var assetsDirectory = System.Web.Hosting.HostingEnvironment.MapPath("~/Assets");
factory.ConfigureDefaultViewService(new IdentityServer3.Core.Services.Default.DefaultViewServiceOptions { CustomViewDirectory = assetsDirectory });