我有一个运行在机器1上的ASP.NET应用程序。
当用户从机器2访问该页面时,我想找到他或她在机器2上登录的用户名。
我尝试使用以下方法:
- Request.LogonUserIdentity.Name - Page.User.Identity.Name - ((WindowsIdentity)HttpContext.Current.User.Identity).Name - ((WindowsIdentity)HttpContext.Current.User.Identity).User - Request.LogonUserIdentity.User 但是都没有起作用。
Request.LogonUserIdentity.Name返回NT AUTHORITY\IUSR,Request.LogonUserIdentity.User返回S-1-5-17,其他所有方法都返回空字符串。NT AUTHORITY\IUSR是运行Web应用程序的计算机上的用户,而不是客户端计算机上的用户。
在web.config中,我禁用了模拟。
当用户从机器2访问该页面时,我想找到他或她在机器2上登录的用户名。
我尝试使用以下方法:
- Request.LogonUserIdentity.Name - Page.User.Identity.Name - ((WindowsIdentity)HttpContext.Current.User.Identity).Name - ((WindowsIdentity)HttpContext.Current.User.Identity).User - Request.LogonUserIdentity.User 但是都没有起作用。
Request.LogonUserIdentity.Name返回NT AUTHORITY\IUSR,Request.LogonUserIdentity.User返回S-1-5-17,其他所有方法都返回空字符串。NT AUTHORITY\IUSR是运行Web应用程序的计算机上的用户,而不是客户端计算机上的用户。
在web.config中,我禁用了模拟。
<authentication mode="Windows"/>
<identity impersonate="false"/>
如何获取访问网页的用户名称?