Closed cranecx closed 5 years ago
You should not need a rewrite rule to add the x- headers with IIS, AspNetCoreModule does that for you. Rewrite rules can also interfere with responses.
/Azure/SignedOn doesn't refer to an MVC Controller, right? The CallbackPath is handled directly by the Auth middleware.
I need the url rewrite because that "lives" in my "public" server (Local IIS), the code is executed in a private server (Kestrel Dev server).
That's right, Azure/SignedOn is handled by UseAuthentication Middleware, do yo have any idea why I get redirect to X-Forwarded-Host value instead of the authority URI at return Challenge?
Rewrite is the only thing I see here that could cause this.
I found the problem, just like @Tratcher says, isn´t the middleware, it´s a IIS ARR feature, I will post how I corrected only in case some else had the same problem.
Hi,
I triying to config a netcore 2.1 MVC App in a reverse proxie (IIS), the things seems good, I've configure my proxie to add
X-Forwarded-Proto
andX-Forwarded-Host
to request headers and works fine withUseForwardedHeaders
middleware. The problem is that when I triying to auth the user by Auzure Active Directory I get redirected to theX-Forwarded-Host
value + the query of Azure ADHere is my Startup:
My challenge result:
The config of IIS:
And I get this screen after challenge result:
The same implementation works fine without the reverse proxy.