【问题标题】:Identity Server 3 with multiple URL for a same ClientIdentity Server 3 与同一客户端的多个 URL
【发布时间】:2017-09-30 20:55:32
【问题描述】:

我为单点登录设计了一个身份服务器。我在不同的域中冲洗了我的客户端应用程序。请看看这个客户

new Client
{
    Enabled = true,
    ClientName = "Super UI",
    ClientId = "Super",
    Flow = Flows.Implicit,
    RequireConsent = false,
    RequireSignOutPrompt =false,
    RedirectUris = new List<string>
    {
        "http://localhost:3001/callback",
        "http://localhost:3002/callback",
        "http://localhost:3003/callback"
    },

    AllowedCorsOrigins = new List<string>
    {
        "http://localhost:3001/",
        "http://localhost:3002/",
        "http://localhost:3003/"
    },
    PostLogoutRedirectUris = new List<string>
    {
        "http://localhost:3001/logout",
        "http://localhost:3002/logout",
        "http://localhost:3003/logout"
    },
    AllowedScopes = new List<string>
    {
        "openid",
        "profile",
        "email",
        "SuperUI"
    }
}

但它失败了,我无法使用此设置登录

如果我使用单个 URL,那么它可以工作

new Client
{
    Enabled = true,
    ClientName = "Super UI",
    ClientId = "Super",
    Flow = Flows.Implicit,
    RequireConsent = false,
    RequireSignOutPrompt =false,
    RedirectUris = new List<string>
    {
        "http://localhost:3001/callback"
    },

    AllowedCorsOrigins = new List<string>
    {
        "http://localhost:3001/"
    },
    PostLogoutRedirectUris = new List<string>
    {
        "http://localhost:3001/logout"
    },
    AllowedScopes = new List<string>
    {
        "openid",
        "profile",
        "email",
        "SuperUI"
    }
}

我搜了很多博客和搜索引擎,对此没有明确的概念,Github中有一个问题https://github.com/IdentityServer/IdentityServer3/issues/3340

请在这方面帮助我。

【问题讨论】:

    标签: c# authentication single-sign-on identityserver3


    【解决方案1】:

    这应该可行。我已经设置了多个这样的客户端。您是否实现了自己的IRedirectUriValidator?这可能包含一个错误。调试应用程序并查看调试输出总能帮助我发现问题(请参阅identityserver logging documentation)。

    附:不要实现你自己的IRedirectUriValidator,因为你的配置应该在没有你自己的实现的情况下工作。

    【讨论】:

    猜你喜欢
    • 2018-09-20
    • 1970-01-01
    • 1970-01-01
    • 2019-07-25
    • 2020-10-06
    • 2020-03-22
    • 2020-01-11
    • 2021-08-07
    • 1970-01-01
    相关资源
    最近更新 更多