Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when requesting discovery dock ( HTTPS required)

I am using Identity server 4. It was working fine in fact still, everything is working. However when I try to call

var client = new HttpClient();
// discover endpoints from metadata
var disco = client.GetDiscoveryDocumentAsync(IDPBaseURL).Result;
it gives me error         
http://xxx.x.x.xx:8080/.well-known/openid-configuration: HTTPS required.

It's working from Visual studio and local IIS deployment. However i am facing this error only when deploying on the server.

any Idea?

like image 412
Fawad Ali Siddiqi Avatar asked Jan 18 '19 10:01

Fawad Ali Siddiqi


1 Answers

I ran into this same issue and solved it by changing the policy on the discovery document request.

var client = new HttpClient();
var disco = await client.GetDiscoveryDocumentAsync(new DiscoveryDocumentRequest {
    Address = "http://xxx.xxx.x.xxx:xxxx",
    Policy =
    {
        RequireHttps = false
    }
});
like image 87
Robooto Avatar answered Sep 21 '22 15:09

Robooto