Search code examples
iis-expresspostman

ASP.NET Unauthorized in Postman using IIS Express, but works in Chrome


I am trying to test an ASP.NET Web Api locally using IIS Express. When I use Chrome and hit the url (localhost:5000/api/test, for example) the json displays fine, but when using Postman I keep getting unauthorized 401.2 when hitting the same url. The api controller has Anonymous access on the route.

On the error message, one of the likely causes is:

Integrated authentication is enabled and the request was sent through a proxy that changed the authentication headers before they reach the Web server.

Is Postman somehow changing the headers?


Solution

  • Looks like it's your proxy.

    I haven't found the proxy setting in postman. So I deleted postman for Win and installed postman for Chrome. Possibly Postman gets the environment from Chrome.

    Anyway the resolution is to use Postman for Chrome instead of Postman for Win.