Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

MS-ASPNETCORE-TOKEN error hosting an ASP.NET Core 2.0 Web API on IIS 8 #448

Closed
AdrienTorris opened this issue Oct 11, 2017 · 6 comments
Closed

Comments

@AdrienTorris
Copy link

I have some trouble hosting an ASP.NET Core 2.0 Web API on IIS 8.

I have this error : fail: Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware[0]
'MS-ASPNETCORE-TOKEN' does not match the expected pairing token 'SOME_GUID_HERE', request rejected.

@Tratcher
Copy link
Member

That's a first. This check is to prevent the application from accepting requests from anywhere but the IIS reverse proxy. It sounds like something is trying to access the app directly via localhost. Is this error for requests you are making or are you only seeing these in your logs?

@AdrienTorris
Copy link
Author

Ok I fixed it.
I had a problem with my configuration file, the one who defined the server.urls value. It takes me 4 or 5 hours I think but it's working now, sorry to disturbed you.

@geirsagberg
Copy link

@AdrienTorris Having a similar problem, only with IIS Express; what was your solution?

@HB-2012
Copy link

HB-2012 commented Feb 14, 2018

@geirsagberg I just ran into this issue because I disabled the option "Launch browser". This results in an address being printed in the output window, but that address is actually incorrect. You have to use the address that is configured in the "App URL" field.

You can get to these settings through Project Properties > Debug

@HristoHentov
Copy link

HristoHentov commented Oct 19, 2018

This is quite an old issue, however I wonder if anyone here knows if I this "validation" can be disabled.
The reason I would want to disable it, is since I have a health-check endpoint that is called from a service discovery app, and it only knows the actual port, where the kestrel-hosted app is.
Since this validation rejects the request, I return a status code of 400, which causes the check to fail.
In the future, we would probably find a way to query the IIS proxy, but I am currently interested if there is any way to disable this validaiton

@Tratcher
Copy link
Member

No it can't.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants