Ehsan Zargar Ershadi
Ehsan Zargar Ershadi

Reputation: 24833

How to disabling SSL for identityserver4

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

Answers (3)

Vincent T.
Vincent T.

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

Ehsan Zargar Ershadi
Ehsan Zargar Ershadi

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

bobek
bobek

Reputation: 8020

Set RequireHttpsMetadata to false in AddIdentityServerAuthentication like this:

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

Upvotes: 0

Related Questions