Hoho
Hoho

Reputation:

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

Been googling this but cannot find any good info.

What's the difference (aside from the obvious) in functionality between these two commands?

I simply need to ensure that I get the name of the logon user for my asp.net web application.

Thanks.

Upvotes: 1

Views: 7787

Answers (1)

Ashraf Sabry
Ashraf Sabry

Reputation: 3182

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

In the above reference, it's said that the two variables normally hold the same value.

I made a test on a site that is set to use basic http authentication, to find that REMOTE USER is set to empty string while LOGON_USER is set to the user name I used to login to the site.

Note that the value of the two variables is different than the name of the windows user that the application runs under (unless you place <identity impersonate="true"/> in web.config), which can be obtained by calling

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

Upvotes: 3

Related Questions