I want to get the username of the logon username and domain. My code for getting it, is in a controller:
User.Identity.GetUserId()
In my web.config is:
<system.web>
<identity impersonate="false"/>
<authentication mode="Windows" />
<compilation debug="true" targetFramework="4.6.1" />
<httpRuntime />
<pages controlRenderingCompatibilityVersion="4.0" />
</system.web>
Currently, I only get a empty string. What I have to change to get the Windows username information?
Sidenote for others: While my research, I also got to the following:
Environment.UserDomainName + @"\" + Environment.UserName
In reference to this, it only delivers the identity in which the thread is running and not the windows information.
EDIT1: I'm currently testing my program in debugging mode.