【发布时间】:2019-03-02 12:13:21
【问题描述】:
在 IdentityServer4 中使用 Discovery 时如何禁用 HTTPS 要求? 我在本地服务器上工作,当我使用自签名证书(使用 openssl)时无法信任它,当我使用 http 时返回错误:需要 Https。
【问题讨论】:
标签: asp.net-core-2.0 identityserver4
在 IdentityServer4 中使用 Discovery 时如何禁用 HTTPS 要求? 我在本地服务器上工作,当我使用自签名证书(使用 openssl)时无法信任它,当我使用 http 时返回错误:需要 Https。
【问题讨论】:
标签: asp.net-core-2.0 identityserver4
在您的项目中,在 Startup.cs 中使用受保护的 API 或客户端项目的 public void ConfigureServices(IServiceCollection services) 方法:
.AddIdentityServerAuthentication(options => {
.
.
.
options.RequireHttpsMetadata = false;
});
或
.AddOpenIdConnect("oidc", options => {
.
.
.
options.RequireHttpsMetadata = false;
});
【讨论】: