问题
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