我在 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
我修改了ClientId
,ClientSecret
并RedirectUri
匹配 IdSrv 中的客户端设置。现在,当我尝试导航到需要授权的页面时,我被重定向到 IdentityServer 的 URL。当我登录时,断点AuthorizationCodeReceived
在客户端的通知处命中,Startup.cs
然后进入循环。浏览器状态显示:
Waiting for localhost...
Waitnig for auth.mydomain.com...
Waiting for localhost...
Waitnig for auth.mydomain.com...
...
依此类推,永远不会完成登录。为什么会这样?请帮忙。
谢谢!