首页 > 解决方案 > 如何使用新的 Identity.UI 在 Angular 6 中设置 loginurl 以使用 asp.netcore 2.1

问题描述

如何让我的登录网址从我的 Angular 应用程序中更改...../Account/Login..../Identity/Account/Login?我的客户是一个 Angular 6 应用程序,我正在使用angular-auth-oidc-client.

谢谢

标签: angular6identityserver4asp.net-core-2.1

解决方案


当您调用 AddIdentityServer 时,像这样调用它

services.AddIdentityServer(SetupIdentityServer)

并使用此静态方法。

private static void SetupIdentityServer(IdentityServerOptions identityServerOptions)
    {
        identityServerOptions.UserInteraction.LoginUrl = "/Identity/Account/Login";
    }

推荐阅读