# 402.1 Unauthorized when trying hit an endpoint running in IIS Express

**URL:** <https://community.postman.com/t/402-1-unauthorized-when-trying-hit-an-endpoint-running-in-iis-express/9044>\
**Category:** Help Hub\
**Tags:** authentication\
**Created:** [November 16, 2019, 9:51pm UTC](https://community.postman.com/t/402-1-unauthorized-when-trying-hit-an-endpoint-running-in-iis-express/9044 "2019-11-16T21:51:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JDPostman](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@JDPostman](https://community.postman.com/u/JDPostman)\
**Post date:** [November 16, 2019, 9:51pm UTC](https://community.postman.com/t/402-1-unauthorized-when-trying-hit-an-endpoint-running-in-iis-express/9044/1 "2019-11-16T21:51:40Z")

</div>

I used to be able to do this, but I can’t figure out why it isn’t working any more. I did recently update Windows, so that may be it. I need to be able to GET and POST to my LOCALHOST:52455 running on IIS Express so I can debug my code. I am able to access the endpoint via a web browser, but if I take the same URL and put it in Postman, I get the error below. I have tried changing virtually every single flag or setting in various applicationhost.config, application.json, and web.config file there is. Basic GETs always work in the browser but nothing works in Postman.

I believe this is a bug in Postman, as I have exhausted all configuration issues in IIS.

Error:  
IIS 10.0 Detailed Error - 401.2 - Unauthorized

HTTP Error 401.2 - Unauthorized  
You are not authorized to view this page due to invalid authentication headers.

No authentication protocol (including anonymous) is selected in IIS.  
Only integrated authentication is enabled, and a client browser was used that does not support  
integrated authentication.  
Integrated authentication is enabled and the request was sent through a proxy that changed the  
authentication headers before they reach the Web server.  
The Web server is not configured for anonymous access and a required authorization header was  
not received.  
The “configuration/system.webServer/authorization” configuration section may be explicitly  
denying the user access.

Things you can try:  
Verify the authentication setting for the resource and then try requesting the resource using  
that authentication method.  
Verify that the client browser supports Integrated authentication.  
Verify that the request is not going through a proxy when Integrated authentication is used.  
Verify that the user is not explicitly denied access in the  
“configuration/system.webServer/authorization” configuration section.  
Check the failed request tracing logs for additional information about this error.

IIS Web Core

Notification AuthenticateRequest Handler aspNetCore Error Code 0x80070005 Requested URL http://localhost:52455/Lookup/getMaterialGroups Physical Path C:\{mypath}\Lookup\getMaterialGroups Logon Method Not yet determined Logon User Not yet determined

Request Tracing Directory  
C:{MyDocuments}\IISExpress\TraceLogFiles{myprojname}

More Information:

This error occurs when the WWW-Authenticate header sent to the Web server is not supported by the server configuration. Check the authentication method for the resource, and verify which authentication method the client used. The error occurs when the authentication methods are different. To determine which type of authentication the client is using, check the authentication settings for the client.

Microsoft Knowledge Base Articles:  
907273  
253667

---

<div class="post-metadata">

**Author:** ![MadhuriPandey20](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@MadhuriPandey20](https://community.postman.com/u/MadhuriPandey20)\
**Post date:** [March 19, 2021, 7:32pm UTC](https://community.postman.com/t/402-1-unauthorized-when-trying-hit-an-endpoint-running-in-iis-express/9044/2 "2021-03-19T19:32:06Z")

</div>

How did you resolve this?

---

<div class="post-metadata">

**Author:** ![RahulKeshri](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RahulKeshri](https://community.postman.com/u/RahulKeshri)\
**Post date:** [May 28, 2021, 6:47am UTC](https://community.postman.com/t/402-1-unauthorized-when-trying-hit-an-endpoint-running-in-iis-express/9044/3 "2021-05-28T06:47:34Z")

</div>

After much research and try… Get my similar issue fixed via below ways.

So , Basically , This is not a bug in Postman. The error clearly states that Postman is trying to hit API using Windows Authentication and this must have been enabled .

Your csproj file basically should be having properties as below  
IISExpressAnonymousAuthentication → enabled  
IISExpressWindowsAuthentication → disabled

1. Select project in Solution Explorer
2. Press F4 to get to properties (different than the right click properties)
3. Change _Windows Authentication_ to **disabled** and Anonymous Authentication to enabled.

---

<div class="post-metadata">

**Author:** ![pth1706](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pth1706](https://community.postman.com/u/pth1706)\
**Post date:** [March 8, 2023, 4:42am UTC](https://community.postman.com/t/402-1-unauthorized-when-trying-hit-an-endpoint-running-in-iis-express/9044/4 "2023-03-08T04:42:28Z")

</div>

Thank you so much, resolved
