Reputation: 24833
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.
Upvotes: 5
Views: 11080
Reputation: 33
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();
Upvotes: 1
Reputation: 24833
With the clue from @Hbert Jarema I was able to find it in the documentation:
services.AddAuthentication()
.AddOpenIdConnect(options =>
{
options.RequireHttpsMetadata = false;
});
Upvotes: 6
Reputation: 8020
Set RequireHttpsMetadata
to false in AddIdentityServerAuthentication
like this:
.AddIdentityServerAuthentication(options => {
options.RequireHttpsMetadata = false
});
Upvotes: 0