我想在登录页面上创建一个重定向到 http://server/resetpassword/ 的 URL并且会有我的 cusotm 页面,从示例中制作 CustomViewServices,但是没有示例如何添加您自己的页面
https://github.com/IdentityServer/IdentityServer3.Samples/tree/master/source/CustomViewService
有什么想法吗?
最佳答案
不必创建 CustomViewService,您可以在 AuthenticationOptions(在您的启动类中)中添加以下代码来处理这种情况
LoginPageLinks = new List<LoginPageLink>()
{
new LoginPageLink()
{
Href = "resetpassword",
Text = "Reset Your Password",
Type = "resetPassword"
}
}
在日志页面中,有如下代码,
<ul class="list-unstyled">
<li ng-repeat="link in model.additionalLinks"><a ng-href="{{link.href}}">{{link.text}}</a></li>
</ul>
因此在您的 AuthenticationOptions 中使用此自定义,这将添加一个指向您的自定义页面的链接。
然后您需要在模板文件夹中添加一个 resetpassword.html 页面。
关于c# - Identity Server v3 自定义页面重置密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31046208/