Groups | Blog | Home
all groups > asp.net security > october 2005 >

asp.net security : HttpContext.Current.User.Identity.Name & ServerVariable("LOGON_USE



Barry
10/26/2005 5:58:01 AM
I have an Intranet application that uses the
System.Web.HttpContext.Current.User.Identity.Name to grab the DOMAIN\USERNAME
of the current user.

SCENARIO:
The user logs into their machine with their id/password and authenicates
against the domain. Fine. That works. However, when this user surfs to my
Intranet application the Current.User.Identity.Name returns a different
USERNAME than what was logged into the machine with.

While troubleshooting this issue, I found that when using the
SERVERVARIABLE("LOGON_USER") to get the DOMAIN\USERNAME, the correct USERNAME
is returned.

Does anybody have an idea as to why the two would produce different results?

Thanks in advance.
Dominick Baier [DevelopMentor]
10/26/2005 7:37:22 AM
Hello Barry,

who is logged on - and what does it return?

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

[quoted text, click to view]

Barry
10/26/2005 7:57:08 AM
The user (Non-Admin) logs onto their machine with, as an example, ID TT1234.
However, the Current.User.Identity.Name returns TP1234.

If I use the ServerVariable("LOGON_USER") the correct ID, TT1234, is
returned.

This only happens for this one particular user.



[quoted text, click to view]
Patrick.O.Ige
10/30/2005 12:00:00 AM
Have you tried using User.Identity.Name?
Are you in a Active Directory environment?
Patrick


[quoted text, click to view]

AddThis Social Bookmark Button