asp.net-core-2.0 - 如何在 IdentityServer4 中禁用 SSL?

标签 asp.net-core-2.0 identityserver4

在 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/

相关文章:

c# - Asp.Net core 2.0 - 翻译服务器端消息

C# .net core 2.1 Authorization的异常处理

c# - 带有 Windows/AD 身份验证的 IdentityServer4 不起作用?

asp.net-core-2.0 - 如何在 ASP.NET Core 2.0 中为 EFCore 2 配置 SQL 日志记录

c# - 在内存中使用 SQLite 运行 EF Core - 未配置数据库提供程序

asp.net-core-2.0 - 在 IIS 中并行运行多个 ASP.NET Core 2.2 Web 应用程序

c# - Identity Server 4 - 注销 - 传递附加数据

asp.net-core - 使用 IdentityServer4 时出现 "code challenge required"

identityserver4 - PersistedGrants 表没有被写入?

c# - GetDiscoveryDocumentAsync : "An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set."