Prior reference (.Net Framework/ASP.Net MVC):
- the origin is
https
- the redirect uri sent to Google Auth is
http
- this will always fail
https
http
- this will always failCan anyone point me to relevant docs/source on how to add/override options in .Net 6 and above? (similar to prior implementations in .Net Framework/MVC)?
CodePudding user response:
The answer is in the comment by @Tratcher:
Official Ref: Configure ASP.NET Core to work with proxy servers and load balancers
Essentially: ForwardedHeadersMiddleware
For my specific case:
In some cases, it might not be possible to add forwarded headers to the requests proxied to the app. If the proxy is enforcing that all public external requests are HTTPS, the scheme can be manually set before using any type of middleware:
... app.Use((context, next) => { context.Request.Scheme = "https"; return next(context); }); ...