IPrincipal 接口相关信息
来源:互联网 发布:java jaxbelement 编辑:程序博客网 时间:2024/05/21 18:33
本页内容
目标适用范围如何使用本章内容摘要IIS 匿名身份验证IIS 基本身份验证IIS 摘要式身份验证IIS 集成 Windows目标
本章的目标是:
•了解 ASP.NET 标识
适用范围
本章适用于以下产品和技术:
Windows 2000 Server 2000 SP3
Microsoft .NET Framework SP2
Microsoft SQL Server 2000 SP2
如何使用本章内容
本章是《构建安全的 ASP .NET 应用程序》指南的参考章节。它包含一些补充信息,可以帮助您进一步了解本指南其他章节中所述的解决方案,应在阅读时一并阅读。
摘要
主体对象实现 IPrincipal 接口并表示特定用户(代码代表该用户运行)的安全性上下文。主体对象包括用户的标识(作为包含的 IIdentity 对象)和用户所属的任何角色。
ASP.NET 提供了以下主体和标识对象实现:
•WindowsPrincipal 和 WindowsIdentity 对象表示已使用 Windows 身份验证验证了身份的用户。对于这些对象,可以从 Windows 用户所属的 Windows 组集中自动获取角色列表。
•GenericPrincipal 和 GenericIdentity 对象表示已使用窗体身份验证或其他自定义身份验证机制验证了身份的用户。对于这些对象,以自定义方式获取角色列表(通常是从数据库中获取的)。
•FormsIdentity 和 PassportIdentity 对象分别表示已使用窗体身份验证和 Passport 身份验证验证了身份的用户。
以下各表说明了在 IIS 身份验证设置的范围内,从保存 IPrincipal 和/或 IIdentity 对象的每个变量中获取的结果标识。表中使用了以下缩写词:
•HttpContext = HttpContext.Current.User,它返回包含当前 Web 请求的安全信息的 IPrincipal 对象。这是经身份验证的 Web 客户端。
•WindowsIdentity = WindowsIdentity.GetCurrent(),它返回当前执行的 Win32 线程的安全性上下文的标识。
•Thread = Thread.CurrentPrincipal,它返回当前执行的 .NET 线程(在 Win32 线程之上)的主体。
IIS 匿名身份验证
Web.config 设置变量位置结果标识<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
用户提供的名称
IIS 集成 Windows
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
用户提供的名称
- IPrincipal 接口相关信息
- IPrincipal 和 IIdentity 接口
- IPrincipal 和 IIdentity 接口
- IMediaSeeking 相关接口信息
- 信息公开系统webservice接口相关
- 如何使用ICredentialProviderUserArray 接口获得用户名等相关信息
- 获取Android各类系统相关信息的接口实现代码
- 相关接口
- 如何实现 IPrincipal
- 如何实现 IPrincipal
- IPrincipal和IIdentity
- 自定义IPrincipal 使用
- 支付宝手机网页即时到账接口(1)之相关信息介绍
- 提取网络接口信息
- 公交信息查询接口
- 天气信息接口
- 气象局天气预报信息接口
- 压缩读取接口信息
- 给盒子的贺文
- 黑马程序员——用AWT写的假记事本,实现退出,保存,打开等功能
- Windows 系统debug级 进程调试工具 ntsd 详解
- LaTeX排版常用字体和格式设置
- 排序算法复习笔记
- IPrincipal 接口相关信息
- 敏捷需求分析要点
- 落花泪,与君诀
- 字符串查询条件预处理 就是查询时某变量进行过滤处理
- 页面压缩功能开启
- 百度面试题——malloc/free和new/delete的异同
- ajaxReturn方法可以更加灵活的进行ajax传值 不只限那三个名称,可以多个
- 紫薇花开的季节(二)
- Action类增加_param方法 就是自动判断是 get 还是 post 的方法 ,很方便