【问题标题】:How to disable SSL in IdentityServer4?如何在 IdentityServer4 中禁用 SSL?
【发布时间】:2019-03-02 12:13:21
【问题描述】:

在 IdentityServer4 中使用 Discovery 时如何禁用 HTTPS 要求? 我在本地服务器上工作,当我使用自签名证书(使用 openssl)时无法信任它,当我使用 http 时返回错误:需要 Https。

【问题讨论】:

    标签: asp.net-core-2.0 identityserver4


    【解决方案1】:

    在您的项目中,在 Startup.cs 中使用受保护的 API 或客户端项目的 public void ConfigureServices(IServiceCollection services) 方法:

    .AddIdentityServerAuthentication(options => {
           .
           .
           .
        options.RequireHttpsMetadata = false;
    });
    

    .AddOpenIdConnect("oidc", options => {
           .
           .
           .
        options.RequireHttpsMetadata = false;
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-13
      • 2018-08-24
      • 1970-01-01
      • 2021-12-14
      • 2022-08-04
      • 2015-04-02
      • 1970-01-01
      • 2020-08-05
      相关资源
      最近更新 更多