IdentityServer MVC 在 Azure 中托管时抛出 OpenIdConnectProtocolException

IdentityServer MVC throws OpenIdConnectProtocolException when hosted in Azure

我使用 AspNetIdentity Quickstart 作为 basis.It 在本地运行良好,但是当我在 Azure 中托管我的 IdentityServer 并将其与本地 MVC 应用程序一起使用时,我遇到了各种错误:

我从本地文件加载了我的证书,因为我认为这是错误最少的修剪解决方案,直到我把它弄好 运行。猜猜谁错了。

它在本地工作,但在我登录 Azure 时出现上述错误。有趣的是,它并没有在启动时失败,甚至在

处甚至暴露了一个 public 密钥

https://"MyIdentityServer".azurewebsites.net/.well-known/openid-configuration/jwks

解决方案:使用更复杂的方法,参见:

https://docs.microsoft.com/en-us/azure/app-service/configure-ssl-certificate-in-code