I am building an ASP.NET MVC intranet app for my organization and want to get the network user name. I have the following in my Web.config
<system.web>
<authentication mode="Windows"> </authentication>
<authorization>
<allow users="*"/>
<deny users="?"/>
</authorization>
When I am debugging with IIS Express, Request.LogonUserIdentity.Name
gives my windows username.
However, when in deploy my app on IIS, Request.LogonUserIdentity.Name
is coming as "NT AUTHORITY\IUSR"
instead of the windows username.
In IIS, for my app, I have enabled just Windows Authentication and disabled other types of authentication.
What change do I need to make in IIS so that Request.LogonUserIdentity.Name
gives the logged in windows username?