I have an aspx page that uses some code behind to populate a textbox with the network user id...
System.Security.Principal.WindowsIdentity a = System.Security.Principal.WindowsIdentity.GetCurrent();
BoxRecordCreatedBy.Text = a.Name.Split(new char[] { '\\' })[1];
...and in my web config have windows authentication turned on...
<authentication mode="Windows" />
...but was getting 404 error until I added this to my web.config...
<appSettings> <add key="owin:AutomaticAppStartup" value="false"/> </appSettings>
...so now the page loads and when I run the page in debug my userid populates the textbox as expected but after I publish the page and access it it populates the textbox with a service account...
svc-webapps
Windows authentication is enabled on the IIS server as well.
Could someone kindly show me what I'm doing wrong and how to correct it?
Thanks as tonne, Roscoe