title: How to get currently logged in Windows user ID on client side
body: <p>I have a web application that allows the users to access the pages if their Windows login name to the domain is in the web config's app settings. </p>
  
  <p>For example: 
  Logged on username: SampleDomain\SampleUser</p>
  
  <p>on Web.config:</p>
  
  <pre><code>&lt;appSettings&gt;
      &lt;add key=AuthorizedUsers value="SampleUser,SampleBooger" /&gt;
  &lt;/appSettings&gt;
  &lt;authentication mode="Windows"/&gt;
  </code></pre>
  
  <p>*<em>successful scenario: SampleUser should be able to browse the website.</em></p>
  
  <p>I was able to do it successfully during development (locally on my machine), but when I deployed it to a server then I try to browse it from my local machine, the Windows login that it gets is NT AUTHORITY\NETWORK SERVICE so it redirects to my customized error page. I, SampleUser, am in the AuthorizedUsers. I should be able to browse it.</p>
  
  <p>Please help me.</p>
  
  <p>Thank you very much.</p>