I am facing the problem where User.Identity.Name coming back empty ONLY on my local Visual Studio Environment. When the site is published on IIS, it works all fine and gets the correct user.
I searched for the problem online but it looks like most of the solution suggested are suggested for IIS environment and asking to change the config file. My config file looks as following:
<system.web>
<compilation debug="true" targetFramework="4.6" />
<httpRuntime targetFramework="4.6" />
<customErrors mode="Off" />
<authentication mode="Windows" />
<!--<authorization>
<allow roles="IS APPS" />
<deny users="?" />
</authorization>-->
</system.web>
I had to comment out the part where it does because if I turn it on, I run into 401.2 HTTpError