Difference in ASP.Net "REMOTE_USER" and "LOGON_USER"

It looks like it doesn't, but can't find any good information.

What's the difference (besides the obvious one) in functionality between these two commands?

  • HttpContext.Current.Request.ServerVariables ("REMOTE_USER")
  • HttpContext.Current.Request.ServerVariables ("LOGON_USER")

I just need to make sure I get the login username for my asp.net web app.

Thanks.

+1


a source to share


1 answer


You can see the meaning of all these variables here: http://msdn.microsoft.com/en-us/library/ms524602.aspx

The link above says that two variables usually have the same meaning.

I did a test on a site that is configured to use HTTP Basic Authentication to find that REMOTE USER is set to an empty string and LOGON_USER is set to the username I used to login to the site.



Note that the value of the two variables is different from the Windows username that the application is running under (unless you put it <identity impersonate="true"/>

in web.config) which can be obtained by calling

System.Security.Principal.WindowsIdentity.GetCurrent().Name

      

+3


a source







All Articles