Web.config file
<authentication mode="Windows" />
<authorization>
<allow users ="*" />
</authorization>
IIS permissions
(Unchecked)Enable ananymouse access
(Checked)Integrated windows authentication
C# code,
welcomeUser.InnerText = Request.ServerVariables.Get("LOGON USER");
What am I missing to be able to display Windows User ID ?
I think the variable is
LOGON_USERisn’t it? (With underscore) See hereYou may find that this gives you IUSR_MachineName though, so you might want to look up better ways of finding the actual logged in user, such as
User.Identity.Nameor by usingWindowsIdentity.GetCurrent().Name;