在 IdentityServer4 中使用 Discovery 时如何禁用 HTTPS 要求?
我在本地服务器上工作,当我使用自签名证书(使用 openssl)时不能信任它,当我使用 http 时,错误返回:需要 Https。
最佳答案
在您的项目中使用 protected API 或客户端项目的 public void ConfigureServices(IServiceCollection services)
Startup.cs 中的方法:
.AddIdentityServerAuthentication(options => {
.
.
.
options.RequireHttpsMetadata = false;
});
或者
.AddOpenIdConnect("oidc", options => {
.
.
.
options.RequireHttpsMetadata = false;
});
关于asp.net-core-2.0 - 如何在 IdentityServer4 中禁用 SSL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52522430/