I used visual studio 2015 created a simple web api project on my office PC which Windows logged in company Domain(AD). I changed web.config file for integration authentication - <system.web><authentication mode="Windows" />
. The url http://localhost:23151/api/Model1 returns a valid xml data from database.
I changed Anonymous Authentication to Disabled and Windows Authentication to Enabled in the project property for IIS Express (Development Server) settings.
I set a break point in public IQuerybal<Model1> GetModel1()
and check the value of User.Identity.Name
and it returns null
?
Updates:
What's strange is I created a new project on another PC (still in Visual studio 2015) and I can got my Windows login from property User.Identity.Name
.
Update 2: I tried to copy the project files to the new PC and it still got the same issue. So it should be some settings in the project. Very strange.