我尝试通过在我的网络应用程序的根目录中添加login.html
文件夹并在其中放置https://localhost:44343/identity
来遵循本指南https://identityserver.github.io/Documentation/docs/advanced/customizingViews.html。
然而,当导航将我带到{{1}}时,我看到的登录页面仍然是默认页面。
我做错了什么,为什么不选择被覆盖的登录页面?我正在使用IdentityServer3 2.5.0。
答案 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 });