Edit: more detailed explanation
We have the following setup:
NGINX reverse proxy set to do SSL offload. All internal communication goes through HTTP. The setup of the redirect is like this:
proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Original-For $proxy_add_x_forwarded_for; proxy_set_header X-Original-Proto $scheme; proxy_cache_bypass $http_upgrade;IS4 has the following setup before app.UseIdentityServer
var fordwardedHeaderOptions = new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto }; fordwardedHeaderOptions.KnownNetworks.Clear(); fordwardedHeaderOptions.KnownProxies.Clear(); app.UseForwardedHeaders(fordwardedHeaderOptions);On the client side RequireHttpsMetadata is being set to FALSE
On the IS4 side all the Clients are configured to have HTTPS addresses for "RedirectUris" and "PostLogoutRedirectUris".
On the Client side IdentityServerAuthenticationOptions are configured like this:
new IdentityServerAuthenticationOptions { Authority = "https://[OAUTH_ADDRESS]", ApiName = "[API_NAME]", ApiSecret = "[API_SECRET]", RequireHttpsMetadata = false }
What actually happens is that when we try to visit one of our registered in IS4 Clients and the request is being redirected to IS4 for authentication we have "Unauthorized client" message screen. Furthermore after inspecting the query string of the redirected request we can see that the return URL is HTTP instead of HTTPS.
Please advise.