I have an ASP.NET application that runs on machine 1.
When a user accesses this page from machine 2, I want to find out the username under which he or she logged in to machine 2.
I tried to use
Request.LogonUserIdentity.NamePage.User.Identity.Name((WindowsIdentity)HttpContext.Current.User.Identity).Name((WindowsIdentity)HttpContext.Current.User.Identity).UserRequest.LogonUserIdentity.User
but that will not work.
Request.LogonUserIdentity.Namereturns NT AUTHORITY\IUSR, Request.LogonUserIdentity.User- S-1-5-17, all the rest are empty strings. NT AUTHORITY\IUSR- This is the user on the computer on which the web application is running, and not on the client machine.
Q web.configI turned off giving myself away with
<authentication mode="Windows"/>
<identity impersonate="false"/>
What can I do to get a username that accesses a web page?
source
share