Localhost 上的 Identity Server 4 和 UWP

Identity Server 4 and UWP on Localhost

我希望得到一些帮助,让 Identity Server 4 演示 (https://github.com/IdentityServer/IdentityServer4.Demo) and the OidcClient Samples UWP Client (https://github.com/IdentityModel/IdentityModel.OidcClient.Samples) 在本地主机上工作。

我都下载了,它们都运行。我可以从 Web 浏览器访问 localhost:5000,它会加载身份服务器的主页。在 uwp 示例中,当我单击登录时 returns 和 "Unknown error"。如果我将 uwp 示例指向 demo.identityserver.io 它可以工作,所以示例只在本地主机上不工作。

身份服务器日志显示一些 activity,没有错误,但登录方法上的断点永远不会被击中。我认为这可能是本地环回,但据我所知,在 windows 10 和 visual studio 2017 上,本地环回不再是问题。有没有人能让这两个样本一起工作?

谢谢

UWP 的内部 WAB(Web 身份验证浏览器)仅在您指向 https 端并且站点具有有效证书时才有效。一旦我将 localhost 设置为使用 https 并给它一个证书,它就开始工作了!

您可以通过禁用环回在本地执行此操作, 因为我现在正在做! 有关详细信息,请参阅 here