首页 > 解决方案 > 移动了我的登录页面,现在无法登录

问题描述

我将登录控件从帐户/登录移动到主页,并删除了帐户控制器及其视图。在我的机器上一切正常(当然),但是当我部署到我的测试环境时出现错误:

No webpage was found for the web address: https://identity.blah.blah/account/login?returnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3Dclient.js%26redirect_uri%3Dhttp%253A%252F%252Fblah.blah%26respons etc

我的前端是 Angular 6,我使用 angular-auth-oidc-client。

我的代码中没有任何内容可以创建此 url。sts 服务器 url 只是根 uri,没有帐户/登录名。

{ "stsServer":"https://identity.blah.blah", "redirect_url":"http://app.blah.blah", "client_id":"app.client.js", "response_type":"id_token token", "scope":"openid profile api.v1", "post_logout_redirect_uri":"http://app.blah.blah", "start_checksession":true, "silent_renew":true, "startup_route":"/", "forbidden_route":"/forbidden", "unauthorized_route":"/unauthorized", "log_console_warning_active":true, "log_console_debug_active":false, "max_id_token_iat_offset_allowed_in_seconds":"10" }

有人有什么想法吗?也许这是我需要覆盖的硬编码?

标签: identityserver4angular-auth-oidc-client

解决方案


终于找到了。不是最好的文档...:/

var builder = services.AddIdentityServer(SetupIdentityServer)

private static void SetupIdentityServer(IdentityServerOptions 
  identityServerOptions)
{
  identityServerOptions.UserInteraction.LoginUrl = "/";
  identityServerOptions.UserInteraction.LogoutUrl = "/Home/Logout";
}

推荐阅读