Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

problem getting network user id - svc-webapps shows up instead

$
0
0

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


Viewing all articles
Browse latest Browse all 4737


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>