下表中使用了以下缩写词:
HttpContext = HttpContext.Current.User
WindowsIdentity = WindowsIdentity.GetCurrent()
Thread = Thread.CurrentPrincipal
IIS 匿名身份验证
IIS 集成 Windows 身份验证
HttpContext = HttpContext.Current.User
WindowsIdentity = WindowsIdentity.GetCurrent()
Thread = Thread.CurrentPrincipal
IIS 匿名身份验证
设置 | 变量位置 | 结果标识 |
<identity impersonate="true"/> <authentication mode="Windows" /> | HttpContext WindowsIdentity Thread | - MACHINE/IUSR_MACHINE - |
<identity impersonate="false"/> <authentication mode="Windows" /> | HttpContext WindowsIdentity Thread | - MACHINE/ASPNET - |
<identity impersonate="true" /> <authentication mode="Forms" /> | HttpContext WindowsIdentity Thread | 用户提供的名称 MACHINE/IUSR_MACHINE 用户提供的名称 |
<identity impersonate="false"/> <authentication mode="Forms" /> | HttpContext WindowsIdentity Thread | 用户提供的名称 MACHINE/ASPNET 用户提供的名称 |
IIS 基本身份验证
Web.config 设置 | 变量位置 | 结果标识 |
<identity impersonate="true"/> <authentication mode="Windows" /> | HttpContext WindowsIdentity Thread | 域/用户名 域/用户名 域/用户名 |
<identity impersonate="false"/> <authentication mode="Windows" /> | HttpContext WindowsIdentity Thread | 域/用户名 MACHINE/ASPNET 域/用户名 |
<identity impersonate="true"/> <authentication mode="Forms" /> | HttpContext WindowsIdentity Thread | 用户提供的名称 域/用户名 用户提供的名称 |
<identity impersonate="false"/> <authentication mode="Forms" /> | HttpContext WindowsIdentity Thread | 用户提供的名称 MACHINE/ASPNET 用户提供的名称 |
IIS 摘要式身份验证
Web.config 设置 | 变量位置 | 结果标识 |
<identity impersonate="true"/> <authentication mode="Windows" /> | HttpContext WindowsIdentity Thread | 域/用户名 域/用户名 域/用户名 |
<identity impersonate="false"/> <authentication mode="Windows" /> | HttpContext WindowsIdentity Thread | 域/用户名 MACHINE/ASPNET 域/用户名 |
<identity impersonate="true"/> <authentication mode="Forms" /> | HttpContext WindowsIdentity Thread | 用户提供的名称 域/用户名 用户提供的名称 |
<identity impersonate="false"/> <authentication mode="Forms" /> | HttpContext WindowsIdentity Thread | 用户提供的名称 MACHINE/ASPNET 用户提供的名称 |
Web.config 设置 | 变量位置 | 结果标识 |
<identity impersonate="true"/> <authentication mode="Windows" /> | HttpContext WindowsIdentity Thread | 域/用户名 域/用户名 域/用户名 |
<identity impersonate="false"/> <authentication mode="Windows" /> | HttpContext WindowsIdentity Thread | 域/用户名 MACHINE/ASPNET 域/用户名 |
<identity impersonate="true"/> <authentication mode="Forms" /> | HttpContext WindowsIdentity Thread | 用户提供的名称 域/用户名 用户提供的名称 |
<identity impersonate="false"/> <authentication mode="Forms" /> | HttpContext WindowsIdentity Thread | 用户提供的名称 MACHINE/ASPNET 用户提供的名称 |