I have installed a SharePoint 2013 in my Windows server 2012 development environment. I have configured everything and it worked fine. The problem is that from the machine where the SharePoint is hosted, it asks me for the credentials in a loop, it always responds with 401. If I access from another PC it works. I am using the same DNS to access from both sides. My authorization is with windows.
The above does not matter to me, my problem is that I have an asp.net API on the same server that makes use of ClientContext to connect to this SharePoint. When the API is hosted on the server and makes a request using the ClientContext, it returns a 401. If my API is on my computer launched from visual studio there is no problem. In addition, I have also tried to deploy the API in another environment but pointing to my development environment and everything works fine.
The problem is when I try to access from the same machine where SharePoint is hosted. (The central administration works without problems).