System.Web.Security 命名空间

包含用于在 Web 服务器应用程序中实现 ASP.NET 安全性的类。

名称 说明
ActiveDirectoryMembershipProvider

管理 Active Directory 和 Active Directory 应用程序模式服务器中 ASP.NET 应用程序的成员身份信息的存储。

ActiveDirectoryMembershipUser

公开和更新 Active Directory 数据存储中存储的成员身份用户信息。

AnonymousIdentificationEventArgs

提供 AnonymousIdentification_Creating 事件的数据。 此类不能被继承。

AnonymousIdentificationModule

管理 ASP.NET 应用程序的匿名标识符。

AuthorizationStoreRoleProvider

管理授权管理器策略存储、XML 文件、Active Directory或Active Directory应用程序模式服务器上 ASP.NET 应用程序的角色成员身份信息的存储。

DefaultAuthenticationEventArgs

提供 DefaultAuthentication_OnAuthenticate 事件的数据。 此类不能被继承。

DefaultAuthenticationModule

确保上下文中存在身份验证对象。 此类不能被继承。

FileAuthorizationModule

验证用户是否有权访问所请求的文件。 此类不能被继承。

FormsAuthentication

管理 Web 应用程序的表单身份验证服务。 此类不能被继承。

FormsAuthenticationEventArgs

FormsAuthentication_OnAuthenticate 事件提供数据。 此类不能被继承。

FormsAuthenticationModule

启用表单身份验证时,设置 ASP.NET 应用程序的用户标识。 此类不能被继承。

FormsAuthenticationTicket

提供对用于表单身份验证的票证的属性和值的访问权限,以标识用户。 此类不能被继承。

FormsIdentity

表示使用表单身份验证进行身份验证的用户标识。 此类不能被继承。

MachineKey

提供一种使用用于 ASP.NET 表单身份验证和视图状态的相同算法和密钥值加密或哈希数据(或两者)的方法。

Membership

验证用户凭据并管理用户设置。 此类不能被继承。

MembershipCreateUserException

在成员资格提供程序未成功创建用户时引发的异常。

MembershipPasswordAttribute

验证密码字段是否满足成员资格提供程序的当前密码要求。

MembershipPasswordException

当无法从密码存储中检索密码时引发的异常。

MembershipProvider

定义 ASP.NET 实现以使用自定义成员身份提供程序提供成员身份服务的协定。

MembershipProviderCollection

继承 MembershipProvider 抽象类的对象集合。

MembershipUser

公开和更新成员身份数据存储中的成员身份用户信息。

MembershipUserCollection

MembershipUser 对象的集合。

PassportAuthenticationEventArgs

由一个 Authenticate. 传递给PassportAuthenticationModule事件的事件参数。 由于目前已有标识,因此这主要用于使用提供的标识将自定义 IPrincipal 对象附加到上下文。 此类已弃用。

PassportAuthenticationModule

提供 Passport 身份验证服务的包装器。 此类不能被继承。 此类已弃用。

PassportIdentity

提供供其使用的 PassportAuthenticationModule类。 它为应用程序 Ticket(String) 提供了访问该方法的方法。 此类不能被继承。 此类已弃用。

PassportPrincipal

表示 Passport 身份验证的主体。 此类已弃用。

RoleManagerEventArgs

为类的事件提供事件GetRoles数据RoleManagerModule

RoleManagerModule

RolePrincipal管理当前用户的实例。 此类不能被继承。

RolePrincipal

表示当前 HTTP 请求的安全信息,包括角色成员身份。 此类不能被继承。

RoleProvider

定义 ASP.NET 实现以使用自定义角色提供程序提供角色管理服务的协定。

RoleProviderCollection

继承 RoleProvider 抽象类的对象集合。

Roles

管理角色中的用户成员身份,以便在 ASP.NET 应用程序中进行授权检查。 此类不能被继承。

SqlMembershipProvider

管理SQL Server数据库中 ASP.NET 应用程序的成员身份信息的存储。

SqlRoleProvider

管理SQL Server数据库中 ASP.NET 应用程序的角色成员身份信息的存储。

UrlAuthorizationModule

验证用户是否有权访问请求的 URL。 此类不能被继承。

ValidatePasswordEventArgs

为类的事件提供事件ValidatingPassword数据MembershipProvider

WindowsAuthenticationEventArgs

提供 WindowsAuthentication_OnAuthenticate 事件的数据。 此类不能被继承。

WindowsAuthenticationModule

启用 Windows 身份验证时,设置 ASP.NET 应用程序的用户标识。 此类不能被继承。

WindowsTokenRoleProvider

从Windows组成员身份获取 ASP.NET 应用程序的角色信息。

枚举

名称 说明
ActiveDirectoryConnectionProtection

指定 ActiveDirectoryMembershipProvider 类支持的连接保护选项。

CookieProtection

描述 Cookie 中的信息如何受到保护。

MachineKeyProtection

指定值,该值指示是应加密还是解密数据、是否应追加或验证基于哈希的消息身份验证代码(HMAC),还是同时追加或验证两者。

MembershipCreateStatus

描述 CreateUser(String, String) 操作的结果。

MembershipPasswordFormat

描述用于存储成员身份用户的密码的加密格式。

委托

名称 说明
AnonymousIdentificationEventHandler

表示处理 AnonymousIdentification_Creating 事件 AnonymousIdentificationModule的方法。

DefaultAuthenticationEventHandler

表示处理 DefaultAuthentication_OnAuthenticate 事件 DefaultAuthenticationModule的方法。

FormsAuthenticationEventHandler

表示处理 FormsAuthentication_OnAuthenticate 事件 FormsAuthenticationModule的方法。

MembershipValidatePasswordEventHandler

表示将处理 ValidatingPassword 类事件 MembershipProvider 的方法。

PassportAuthenticationEventHandler

表示处理 PassportAuthentication_OnAuthenticate 事件 PassportAuthenticationModule的方法。 此类已弃用。

RoleManagerEventHandler

定义类事件的GetRoles委托RoleManagerModule

WindowsAuthenticationEventHandler

表示处理 WindowsAuthentication_OnAuthenticate 事件 WindowsAuthenticationModule的方法。

注解

ASP.NET 应用程序使用 Membership 类来验证用户凭据并管理密码和电子邮件地址等用户设置。 通过 Roles 该类,可以根据分配给 Web 应用程序中角色的用户组来管理应用程序的授权。

Membership 类和 Roles 类都与访问应用程序数据存储的提供程序、类一起使用,以检索成员身份和角色信息。 成员身份和角色信息可以使用 SqlMembershipProviderSqlRoleProvider 类存储在Microsoft SQL Server 数据库中; 使用 ActiveDirectoryMembershipProviderAuthorizationStoreRoleProvider 类的Active Directory,或使用 MembershipProviderRoleProvider 类的实现在自定义数据源中。

可以使用 membership 元素(ASP.NET 设置架构)配置 ASP.NET 成员身份。 访问使用成员身份的应用程序时,ASP.NET 创建可用于查询成员身份信息的 Membership 类的实例。 类的特定于提供程序的 MembershipUser 实现包含有关访问页面的用户的信息。 可以为应用程序创建自定义类实现 MembershipUser

可以使用 roleManager 元素(ASP.NET 设置架构)配置 ASP.NET 角色。 ASP.NET 创建包含当前用户角色成员身份信息的 Roles 类的实例。

ASP.NET 提供与 Membership 类和 Roles 类交互的服务器控件。 该 Login控件 CreateUserWizardChangePassword 控件使用该 Membership 类简化创建经过身份验证的 Web 应用程序,并且 LoginView 该控件使用特定于角色的模板为特定用户组自定义网页。

另请参阅