How to disabling SSL for identityserver4

限于喜欢 提交于 2020-01-02 22:07:20

问题


I need to disable SSL/TSL for IdentityServer4 in DotNet Core 2 for test purpose. I have seen this link : disabling SSL for identityserver3 but I need it in version 4.


回答1:


With the clue from @Hbert Jarema I was able to find it in the documentation:

services.AddAuthentication()
    .AddOpenIdConnect(options =>
    {
        options.RequireHttpsMetadata = false;
    });



回答2:


Set RequireHttpsMetadata to false in AddIdentityServerAuthentication like this:

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



回答3:


The Https can be disabled in the client as well. DiscoveryClient can be found in the assembly IdentityModel (NuGet). I use the following code and it works:

    var client = new DiscoveryClient("http://localhost:5000");
    client.Policy.RequireHttps = false;
    var discovery = await client.GetAsync();


来源:https://stackoverflow.com/questions/47019923/how-to-disabling-ssl-for-identityserver4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!