【问题标题】:Getting IDX10803: Unable to create to obtain configuration error in azure VM. Locally working fine获取 IDX10803:无法创建以获取 azure VM 中的配置错误。本地工作正常
【发布时间】:2018-07-27 08:04:51
【问题描述】:

我在我的一个 Azure VM 中托管了在 IIS 中使用自签名证书的身份服务器。这是启用 ssl 的站点。这是使用 identityserver3 框架。

我在同一个 VM 中托管 asp.net core 2.0 webapi,但未启用 ssl。 以下是我在 core 2.0 api 方面的设置:

Startup.cs -> ConfigurationServices() {
            services.AddAuthentication("Bearer")
                    .AddIdentityServerAuthentication(options =>
                    {
                        options.Authority = "https://localhost:44300/identity";
                        options.RequireHttpsMetadata = false;
                        options.ApiName = "web_api";
                        options.LegacyAudienceValidation = true;
                    });
}

通过上述设置,两者在本地都可以正常工作。但是在 vm 中,当我尝试访问 api 时,出现以下错误:

ERROR   Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler - Exception occurred while processing message. - System.InvalidOperationException: IDX10803: Unable to obtain configuration from: 'https://localhost:44300/identity/.well-known/openid-configuration'. ---> System.IO.IOException: IDX10804: Unable to retrieve document from: 'https://localhost:44300/identity/.well-known/openid-configuration'. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: A security error occurred

我确保自签名证书在

中可用

MMC->当前用户和本地计算机中的受信任证书。

自签名证书可用于:

MMC-> 本地计算机 -> 个人证书 本地计算机 -> 受信任的根证书

MMC ->当前用户 -> 受信任的根证书

【问题讨论】:

标签: asp.net-core-2.0 identityserver4 azure-virtual-machine


【解决方案1】:

遇到了同样的问题,直到我发现运行应用程序池(托管 IdentityServer)的用户至少应该对证书具有读取权限。

MMC ->当前用户 -> 受信任的根证书

这是授予您帐户的权利,但请检查哪个是应用程序池帐户,然后在计算机证书中:

右击证书->所有任务->管理私钥

我也意识到,不能给DefaultAppPoolIdentity这样的权限,所以我最终为这个应用程序池使用了一个单独的帐户。

【讨论】:

    猜你喜欢
    • 2016-07-17
    • 2022-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-04
    • 1970-01-01
    相关资源
    最近更新 更多