【问题标题】:May RedirectUris use localhost in production?RedirectUris 可以在生产中使用 localhost 吗?
【发布时间】:2017-10-10 05:23:10
【问题描述】:

愚蠢的问题...在下面显示的示例中将用户重定向到本地主机 即http://localhost:5002/signin-oidc

在我的作品中,我需要将其更改为 https://app.domain.com/signin-oidc?

http://docs.identityserver.io/en/release/quickstarts/6_aspnet_identity.html

new Client
{
ClientId = "mvc",
ClientName = "MVC Client",
AllowedGrantTypes = GrantTypes.HybridAndClientCredentials,

RequireConsent = false,

ClientSecrets =
{
    new Secret("secret".Sha256())
},

RedirectUris           = { "http://localhost:5002/signin-oidc" },
PostLogoutRedirectUris = { "http://localhost:5002/signout-callback-oidc" },

AllowedScopes =
{
    IdentityServerConstants.StandardScopes.OpenId,
    IdentityServerConstants.StandardScopes.Profile,
    "api1"
},
AllowOfflineAccess = true
}

【问题讨论】:

  • 是的,localhost 应该只在客户端是 Web 应用程序时用于测试。不要在生产中包含 localhost 重定向 uri。

标签: asp.net-core identityserver4 asp.net-core-2.0


【解决方案1】:

重定向 URL 应该可供客户端使用。

如果在生产环境中您希望与不在同一台计算机上的客户端进行通信,那么可以,这些 URL 应该可以通过您的目标网络公开访问。

【讨论】:

    猜你喜欢
    • 2011-05-20
    • 2015-08-26
    • 1970-01-01
    • 2010-09-12
    • 1970-01-01
    • 2011-02-17
    • 1970-01-01
    • 1970-01-01
    • 2017-02-13
    相关资源
    最近更新 更多