-
Notifications
You must be signed in to change notification settings - Fork 599
redirect_uri is overwritten to http although app runs on https #1702
Comments
Are you using a reverse proxy? They usually forward over http and set x-forwarded-proto. The UseForwardedHeaders middleware reads x-fowarded-proto and updates the request accordingly. |
@Tratcher That's very alert, indeed I'm using docker swarm with a reverse proxy (traefik).
|
@Tratcher
|
Indeed. Why are you calling Clear()? |
Good question. No specific reason. I learn from you now, that this is a bad idea :) |
You agree that the forwarded header middelware is better than my approach? |
Yes, forwarders are better than re-writing the redirect URL. Many things check the request scheme and the forwarders will help make it correct. |
Thanks, great to get this sorted out so clearly. Many thanks. Closing the issue. |
Sorry, Still trouble with this.
so, I'm using it before the authentication middleware. Is that ok? When I look in my STS logging (so identity server, I'm still getting)
When I use my 'hack', it works. |
Are the headers being added? Could you dump out the request headers in your app to make sure? |
Yeah sorry, I first need to check what the reverse proxy is doing. I reopen the issue and report back to share with others if I need to make specific settings on nginx/traefik level to make this working. |
I had the same problem and the solution was to configure to use the FordwardMiddleware with the Proto header only. If I put other combination it does not works. I dumped the headers and both (XForwardedFor and XForwardedProto) where present. |
Please share your Startup code and headers. |
I have following configureService method
My auth server (identityserver) complains because the incoming redirect_uri coming from the mvc app is http rather than https.
Any idea?
The text was updated successfully, but these errors were encountered: