System.Web.Security 命名空間

包含類別,其可在網頁伺服器應用程式中用來實作 ASP.NET 安全性。 Contains classes that are used to implement ASP.NET security in Web server applications.

類別

ActiveDirectoryMembershipProvider

管理 Active Directory 和 Active Directory 應用程式模式伺服器中 ASP.NET 應用程式之成員資格資訊的儲存。Manages storage of membership information for an ASP.NET application in Active Directory and Active Directory Application Mode servers.

ActiveDirectoryMembershipUser

公開及更新 Active Directory 資料存放區中儲存的成員資格使用者資訊。Exposes and updates membership user information stored in an Active Directory data store.

AnonymousIdentificationEventArgs

提供 AnonymousIdentification_Creating 事件的資料。Provides data for the AnonymousIdentification_Creating event. 此類別無法獲得繼承。This class cannot be inherited.

AnonymousIdentificationModule

為 ASP.NET 應用程式管理匿名識別項。Manages anonymous identifiers for the ASP.NET application.

AuthorizationStoreRoleProvider

管理授權管理員原則存放區中 ASP.NET 應用程式的角色成員資格資訊儲存區,位於 XML 檔案、Active Directory 或 Active Directory 應用程式模式伺服器之中。Manages storage of role-membership information for an ASP.NET application in an authorization-manager policy store, either in an XML file, in an Active Directory, or on an Active Directory Application Mode server.

DefaultAuthenticationEventArgs

提供資料給 DefaultAuthentication_OnAuthenticate 事件。Provides data for the DefaultAuthentication_OnAuthenticate event. 此類別無法獲得繼承。This class cannot be inherited.

DefaultAuthenticationModule

確定內容中有驗證 (Authentication) 物件。Ensures that an authentication object is present in the context. 此類別無法獲得繼承。This class cannot be inherited.

FileAuthorizationModule

確認使用者具有權限,可以存取所要求的檔案。Verifies that the user has permission to access the file requested. 此類別無法獲得繼承。This class cannot be inherited.

FormsAuthentication

管理 Web 應用程式的表單驗證服務。Manages forms-authentication services for Web applications. 此類別無法獲得繼承。This class cannot be inherited.

FormsAuthenticationEventArgs

提供資料給 FormsAuthentication_OnAuthenticate 事件。Provides data for the FormsAuthentication_OnAuthenticate event. 此類別無法獲得繼承。This class cannot be inherited.

FormsAuthenticationModule

在啟用表單驗證時,設定 ASP.NET 應用程式的使用者識別。Sets the identity of the user for an ASP.NET application when forms authentication is enabled. 此類別無法獲得繼承。This class cannot be inherited.

FormsAuthenticationTicket

提供存取票證之屬性和值的權限,票證是搭配表單驗證使用,以識別使用者。Provides access to properties and values of the ticket used with forms authentication to identify users. 此類別無法獲得繼承。This class cannot be inherited.

FormsIdentity

表示使用表單驗證的已驗證使用者識別。Represents a user identity authenticated using forms authentication. 此類別無法獲得繼承。This class cannot be inherited.

MachineKey

提供將資料進行加密或雜湊 (或兩者都進行) 的方法,採用 ASP.NET 表單驗證和檢視狀態所使用的相同演算法和金鑰值。Provides a way to encrypt or hash data (or both) by using the same algorithms and key values that are used for ASP.NET forms authentication and view state.

Membership

驗證使用者認證,並管理使用者設定。Validates user credentials and manages user settings. 此類別無法獲得繼承。This class cannot be inherited.

MembershipCreateUserException

當成員資格提供者未成功建立使用者時,所擲回的例外狀況。The exception that is thrown when a user is not successfully created by a membership provider.

MembershipPasswordAttribute

驗證密碼欄位是否符合成員資格提供者的目前密碼需求。Validates whether a password field meets the current password requirements for the membership provider.

MembershipPasswordException

無法從密碼存放區擷取密碼時,所擲回的例外狀況。The exception that is thrown when a password cannot be retrieved from the password store.

MembershipProvider

定義 ASP.NET 為使用成員資格提供者提供成員資格服務實作的合約。Defines the contract that ASP.NET implements to provide membership services using custom membership providers.

MembershipProviderCollection

繼承 MembershipProvider 抽象類別的物件集合。A collection of objects that inherit the MembershipProvider abstract class.

MembershipUser

公開及更新成員資格資料存放區中的成員資格使用者資訊。Exposes and updates membership user information in the membership data store.

MembershipUserCollection

MembershipUser 物件的集合。A collection of MembershipUser objects.

PassportAuthenticationEventArgs

事件引數,由 Authenticate 傳遞至 PassportAuthenticationModule 事件。The event argument passed to the Authenticate event by a PassportAuthenticationModule. 既然在這個時候已經有識別 (Identity),這將主要有助於使用所提供的識別將自訂的 IPrincipal 物件附加至內容。Since there is already an identity at this point, this is useful mainly for attaching a custom IPrincipal object to the context using the supplied identity. 這個類別已被取代。This class is deprecated.

PassportAuthenticationModule

提供 Passport 驗證服務周圍的包裝函式。Provides a wrapper around Passport Authentication services. 此類別無法獲得繼承。This class cannot be inherited. 這個類別已被取代。This class is deprecated.

PassportIdentity

提供 PassportAuthenticationModule 所使用的類別。Provides a class to be used by PassportAuthenticationModule. 它提供應用程式存取 Ticket(String) 方法的方式。It provides a way for an application to access the Ticket(String) method. 此類別無法獲得繼承。This class cannot be inherited. 這個類別已被取代。This class is deprecated.

PassportPrincipal

表示密碼驗證的原則。Represents a Passport-authenticated principal. 這個類別已被取代。This class is deprecated.

RoleManagerEventArgs

提供 RoleManagerModule 類別的 GetRoles 事件之事件資料。Provides event data for the GetRoles event of the RoleManagerModule class.

RoleManagerModule

管理目前使用者的 RolePrincipal 執行個體。Manages a RolePrincipal instance for the current user. 此類別無法獲得繼承。This class cannot be inherited.

RolePrincipal

表示目前 HTTP 要求的安全性資訊,包括角色成員資格。Represents security information for the current HTTP request, including role membership. 此類別無法獲得繼承。This class cannot be inherited.

RoleProvider

定義 ASP.NET 為使用自訂角色提供者提供角色管理服務所履行的合約。Defines the contract that ASP.NET implements to provide role-management services using custom role providers.

RoleProviderCollection

繼承 RoleProvider 抽象類別的物件集合。A collection of objects that inherit the RoleProvider abstract class.

Roles

管理角色中的使用者成員資格,以在 ASP.NET 應用程式中執行授權檢查。Manages user membership in roles for authorization checking in an ASP.NET application. 此類別無法獲得繼承。This class cannot be inherited.

SqlMembershipProvider

在 SQL Server 資料庫中,管理 ASP.NET 應用程式成員資格資訊的存放。Manages storage of membership information for an ASP.NET application in a SQL Server database.

SqlRoleProvider

在 SQL Server 資料庫中,管理 ASP.NET 應用程式的角色成員資格資訊儲存區。Manages storage of role membership information for an ASP.NET application in a SQL Server database.

UrlAuthorizationModule

驗證使用者確實擁有權限,可以存取所要求的 URL。Verifies that the user has permission to access the URL requested. 此類別無法獲得繼承。This class cannot be inherited.

ValidatePasswordEventArgs

提供 MembershipProvider 類別的 ValidatingPassword 事件之事件資料。Provides event data for the ValidatingPassword event of the MembershipProvider class.

WindowsAuthenticationEventArgs

提供 WindowsAuthentication_OnAuthenticate 事件的資料。Provides data for the WindowsAuthentication_OnAuthenticate event. 此類別無法獲得繼承。This class cannot be inherited.

WindowsAuthenticationModule

在啟用 Windows 驗證 (Authentication) 時,設定 ASP.NET 應用程式的使用者識別。Sets the identity of the user for an ASP.NET application when Windows authentication is enabled. 此類別無法獲得繼承。This class cannot be inherited.

WindowsTokenRoleProvider

從 Windows 群組成員資格取得 ASP.NET 應用程式的角色資訊。Gets role information for an ASP.NET application from Windows group membership.

列舉

ActiveDirectoryConnectionProtection

指定 ActiveDirectoryMembershipProvider 類別 (Class) 支援的連接保護選項。Specifies the connection protection options supported by the ActiveDirectoryMembershipProvider class.

CookieProtection

描述如何保護 Cookie 中的資訊。Describes how information in a cookie is protected.

MachineKeyProtection

指定值,表示資料應該加密或解密,雜湊式訊息驗證碼 (HMAC) 應該附加或驗證,或兩者。Specifies values that indicates whether data should be encrypted or decrypted, whether a hash-based message authentication code (HMAC) should be appended or validated, or both.

MembershipCreateStatus

說明 CreateUser(String, String) 作業的結果。Describes the result of a CreateUser(String, String) operation.

MembershipPasswordFormat

描述用於儲存成員資格使用者密碼的加密格式。Describes the encryption format for storing passwords for membership users.

委派

AnonymousIdentificationEventHandler

代表處理 AnonymousIdentificationModuleAnonymousIdentification_Creating 事件的方法。Represents the method that handles the AnonymousIdentification_Creating event of a AnonymousIdentificationModule.

DefaultAuthenticationEventHandler

表示處理 DefaultAuthenticationModuleDefaultAuthentication_OnAuthenticate 事件的方法。Represents the method that handles the DefaultAuthentication_OnAuthenticate event of a DefaultAuthenticationModule.

FormsAuthenticationEventHandler

表示處理 FormsAuthenticationModuleFormsAuthentication_OnAuthenticate 事件的方法。Represents the method that handles the FormsAuthentication_OnAuthenticate event of a FormsAuthenticationModule.

MembershipValidatePasswordEventHandler

代表將處理 MembershipProvider 類別的 ValidatingPassword 事件之方法。Represents the method that will handle the ValidatingPassword event of the MembershipProvider class.

PassportAuthenticationEventHandler

代表處理 PassportAuthenticationModulePassportAuthentication_OnAuthenticate 事件的方法。Represents the method that handles the PassportAuthentication_OnAuthenticate event of a PassportAuthenticationModule. 這個類別已被取代。This class is deprecated.

RoleManagerEventHandler

GetRoles 類別的 RoleManagerModule 事件定義委派。Defines the delegate for the GetRoles event of the RoleManagerModule class.

WindowsAuthenticationEventHandler

代表處理 WindowsAuthenticationModuleWindowsAuthentication_OnAuthenticate 事件的方法。Represents the method that handles the WindowsAuthentication_OnAuthenticate event of a WindowsAuthenticationModule.

備註

MembershipASP.NET 應用程式會使用類別來驗證使用者認證,以及管理使用者設定,例如密碼和電子郵件地址。The Membership class is used by ASP.NET applications to validate user credentials and manage user settings such as passwords and email addresses. Roles類別可讓您根據指派給 Web 應用程式中角色的使用者群組,來管理應用程式的授權。The Roles class enables you to manage authorization for your application based on groups of users assigned to roles in the Web application.

Membership類別和 Roles 類別都可與提供者搭配使用,以存取應用程式的資料存放區來取得成員資格和角色資訊。Both the Membership class and the Roles class work with providers, classes that access your application's data store to retrieve membership and role information. 成員資格和角色資訊可以使用和類別儲存在 Microsoft SQL Server 資料庫 SqlMembershipProviderSqlRoleProvider ; 在使用和類別的 Active Directory ActiveDirectoryMembershipProviderAuthorizationStoreRoleProvider ,或是使用和類別的實作為自訂資料來源 MembershipProviderRoleProviderMembership and role information can be stored in a Microsoft SQL Server database using the SqlMembershipProvider and SqlRoleProvider classes; in an Active Directory using the ActiveDirectoryMembershipProvider and AuthorizationStoreRoleProvider classes, or in a custom data source using implementations of the MembershipProvider and RoleProvider classes.

您可以使用 (ASP.NET 設定架構) 的成員資格元素 來設定 ASP.NET 成員資格。You configure ASP.NET membership using the membership Element (ASP.NET Settings Schema). 存取使用成員資格的應用程式時,ASP.NET 會建立 Membership 類別的實例,您可以使用此類別來查詢成員資格資訊。When an application using membership is accessed, ASP.NET creates an instance of the Membership class that you can use to query membership information. 提供者特定的類別實作為 MembershipUser 存取頁面之使用者的相關資訊。Provider-specific implementations of the MembershipUser class contain information about the user accessing the page. 您可以為您的應用程式建立類別的自訂實 MembershipUser 作為。You can create custom implementations of the MembershipUser class for your application.

您可以使用 RoleManager 元素 (ASP.NET 設定架構) 來設定 ASP.NET 角色。You configure ASP.NET roles using the roleManager Element (ASP.NET Settings Schema). ASP.NET 會建立類別的實例 Roles ,其中包含目前使用者之角色成員資格的相關資訊。ASP.NET creates an instance of the Roles class that contains information about the role membership of the current user.

ASP.NET 會提供與 Membership 類別和類別互動的伺服器控制項 RolesASP.NET provides server controls that interact with the Membership class and the Roles class. LoginCreateUserWizardChangePassword 控制項可與類別搭配使用, Membership 以簡化已驗證的 Web 應用程式的建立,而 LoginView 控制項則使用角色專屬的範本來自訂特定使用者群組的網頁。The Login, CreateUserWizard, and ChangePassword controls work with the Membership class to simplify creating an authenticated Web application, and the LoginView control uses role-specific templates to customize Web pages for specific groups of users.