Identity Server v3 Custom Page Reset Password

落花浮王杯 提交于 2019-12-17 16:49:08

问题


I want to make on login page a URL that will redirect to http://server/resetpassword/ and there will be my cusotm page, made CustomViewServices from samples, but there is not example how to add your own page

https://github.com/IdentityServer/IdentityServer3.Samples/tree/master/source/CustomViewService

Any ideas?


回答1:


It's not necessary to create a CustomViewService, you can deal with this scenario adding the following code in your AuthenticationOptions (in your startup class)

LoginPageLinks = new List<LoginPageLink>()
                {
                   new LoginPageLink()
                   {
                       Href = "resetpassword",
                       Text = "Reset Your Password",
                       Type = "resetPassword"
                   }
                }

in the logging page, there is the following code,

 <ul class="list-unstyled">
            <li ng-repeat="link in model.additionalLinks"><a ng-href="{{link.href}}">{{link.text}}</a></li>
        </ul>

More info here

So using this customisation in your AuthenticationOptions, this will add a link to your custom page.

Then you need to add a resetpassword.html page in your the template folder.



来源:https://stackoverflow.com/questions/31046208/identity-server-v3-custom-page-reset-password

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!