HTTPS sites behind HTTP load balancers and OpenIdConnect middleware #757
Description
I've encountered an interesting catch-22 case today with our current setup. We have an app which is hosted on a secured domain, e.g. https://mysite.com
. Requests to that domain actually hit a load balancer, which forwards the request to the proper service but via plain-old HTTP.
We've registered our site with Thinktecture's Identity Server to use an HTTPS redirect url for the OpenId callback path. However, the middleware generates the redirect_url parameter based on the current request protocol, which in our case is HTTP since it's coming from the load balancer, and therefore fails. Currently, it fails because http: is not the registered callback url for the app, but even if we registered http: instead, the request would fail anyway because it's not secured.
I heard that ID Server itself supports a load balancer setting (haven't looked into it yet myself), so I'm wondering if the client-side middleware is simply lacking a corresponding feature.
Alternatively, is there a best practice around load balancers which we're not following which obviates the need for explicit middleware support? Or how would you recommend we proceed?