0

In my Silverlight application, I am trying to get the logged windows user id in xxx.web project of xxxx.aspx page by using

<param name="Initparams"
value="UserName=<%=System.Security.Principal.WindowsIdentity.GetCurrent().Name%>"/>

code and am getting the result when running in the local machine. When I deployed it in the server it is getting like **

NETWORK SERVICE

Can anyone give solution for this?

jamesmortensen
  • 33,636
  • 11
  • 99
  • 120
Prabhakaran
  • 1,264
  • 2
  • 20
  • 47

1 Answers1

0

NETWORK SERVICE is probably the Windows identity of the Application Pool for your ASP.NET application. You need to turn off impersonation when using Windows authentication:

<!-- Web.config file. -->
<configuration>
  <system.web>
    <authentication mode="Windows"/>
    <identity impersonate="true"/>
  </system.web>
</configuration>

You also need to configure your IIS settings to use Integrated Windows authentication. This is all assuming you're on a domain.

bitxwise
  • 3,534
  • 2
  • 17
  • 22