【问题标题】:IdentityServer gets into infinite loop of authenticationIdentityServer 进入无限循环的身份验证
【发布时间】:2015-04-21 18:44:26
【问题描述】:

我在 IdentityServer 中设置了以下客户端:

new Client
{
    ClientName = "My web application",
    Enabled = true,
    ClientId = "mywebapp",
    ClientSecrets = new List<ClientSecret>
    {
        new ClientSecret("somesecret")
    },

    Flow = Flows.Hybrid,

    ClientUri = "https://app.mydomain.com",

    RedirectUris = new List<string>
    {
        "oob://localhost/wpfclient",
        "http://localhost:2672/",
        "https://app.mydomain.com"
    }
}

它是在线托管的,比如说https://auth.mydomain.com/core

尝试修改MVC OWIN Client (Hybrid)示例客户端以登录上述身份服务器,在Startup.cs中我修改了ClientIdClientSecretRedirectUri以匹配IdSrv中的客户端设置。现在,当我尝试导航到需要授权的页面时,我被重定向到 IdentityServer 的 URL。当我登录时,断点在客户端的Startup.cs 中的AuthorizationCodeReceived 通知处命中,然后进入循环。浏览器状态显示:

Waiting for localhost...
Waitnig for auth.mydomain.com...
Waiting for localhost...
Waitnig for auth.mydomain.com...
...

以此类推,永远不会完成登录。为什么会这样?请帮忙。

谢谢!

【问题讨论】:

    标签: thinktecture-ident-server openid-connect identityserver3


    【解决方案1】:

    这很可能是由于在重定向中混合了 http 和 https。请始终使用一种方案并检查浏览器地址栏上的方案。

    【讨论】:

    • 哇,就是这样! :)
    • 这个问题解决了很长时间后解决了。由于我使用的是 Azure,我发现有一个小插件可以下载以强制 https 每次
    猜你喜欢
    • 2019-07-31
    • 1970-01-01
    • 2018-03-05
    • 2021-04-22
    • 2015-08-11
    • 1970-01-01
    • 2014-03-01
    • 1970-01-01
    • 2022-10-14
    相关资源
    最近更新 更多