MembershipProvider MembershipProvider MembershipProvider MembershipProvider Class

Definition

Defines the contract that ASP.NET implements to provide membership services using custom membership providers.

public ref class MembershipProvider abstract : System::Configuration::Provider::ProviderBase
public abstract class MembershipProvider : System.Configuration.Provider.ProviderBase
type MembershipProvider = class
    inherit ProviderBase
Public MustInherit Class MembershipProvider
Inherits ProviderBase
Inheritance
MembershipProviderMembershipProviderMembershipProviderMembershipProvider
Derived

Remarks

ASP.NET membership is designed to enable you to easily use a number of different membership providers for your ASP.NET applications. You can use the supplied membership providers that are included with the .NET Framework, or you can implement your own provider.

Note

If you are not familiar with the membership features of ASP.NET, see Introduction to Membership before continuing. For a list of other topics related to membership, see Managing Users by Using Membership.

When implementing a custom membership provider, you are required to inherit the MembershipProvider abstract class.

There are two primary reasons for creating a custom membership provider.

  • You need to store membership information in a data source that is not supported by the membership providers included with the .NET Framework, such as a FoxPro database, an Oracle database, or other data source.

  • You need to manage membership information using a database schema that is different from the database schema used by the providers that ship with the .NET Framework. A common example of this would be membership data that already exists in a SQL Server database for a company or Web site.

The MembershipProvider abstract class inherits from the ProviderBase abstract class. MembershipProvider implementations must also implement the required members of ProviderBase.

Constructors

MembershipProvider() MembershipProvider() MembershipProvider() MembershipProvider()

Initializes a new instance of the MembershipProvider class.

Properties

ApplicationName ApplicationName ApplicationName ApplicationName

The name of the application using the custom membership provider.

Description Description Description Description

Gets a brief, friendly description suitable for display in administrative tools or other user interfaces (UIs).

(Inherited from ProviderBase)
EnablePasswordReset EnablePasswordReset EnablePasswordReset EnablePasswordReset

Indicates whether the membership provider is configured to allow users to reset their passwords.

EnablePasswordRetrieval EnablePasswordRetrieval EnablePasswordRetrieval EnablePasswordRetrieval

Indicates whether the membership provider is configured to allow users to retrieve their passwords.

MaxInvalidPasswordAttempts MaxInvalidPasswordAttempts MaxInvalidPasswordAttempts MaxInvalidPasswordAttempts

Gets the number of invalid password or password-answer attempts allowed before the membership user is locked out.

MinRequiredNonAlphanumericCharacters MinRequiredNonAlphanumericCharacters MinRequiredNonAlphanumericCharacters MinRequiredNonAlphanumericCharacters

Gets the minimum number of special characters that must be present in a valid password.

MinRequiredPasswordLength MinRequiredPasswordLength MinRequiredPasswordLength MinRequiredPasswordLength

Gets the minimum length required for a password.

Name Name Name Name

Gets the friendly name used to refer to the provider during configuration.

(Inherited from ProviderBase)
PasswordAttemptWindow PasswordAttemptWindow PasswordAttemptWindow PasswordAttemptWindow

Gets the number of minutes in which a maximum number of invalid password or password-answer attempts are allowed before the membership user is locked out.

PasswordFormat PasswordFormat PasswordFormat PasswordFormat

Gets a value indicating the format for storing passwords in the membership data store.

PasswordStrengthRegularExpression PasswordStrengthRegularExpression PasswordStrengthRegularExpression PasswordStrengthRegularExpression

Gets the regular expression used to evaluate a password.

RequiresQuestionAndAnswer RequiresQuestionAndAnswer RequiresQuestionAndAnswer RequiresQuestionAndAnswer

Gets a value indicating whether the membership provider is configured to require the user to answer a password question for password reset and retrieval.

RequiresUniqueEmail RequiresUniqueEmail RequiresUniqueEmail RequiresUniqueEmail

Gets a value indicating whether the membership provider is configured to require a unique email address for each user name.

Methods

ChangePassword(String, String, String) ChangePassword(String, String, String) ChangePassword(String, String, String) ChangePassword(String, String, String)

Processes a request to update the password for a membership user.

ChangePasswordQuestionAndAnswer(String, String, String, String) ChangePasswordQuestionAndAnswer(String, String, String, String) ChangePasswordQuestionAndAnswer(String, String, String, String) ChangePasswordQuestionAndAnswer(String, String, String, String)

Processes a request to update the password question and answer for a membership user.

CreateUser(String, String, String, String, String, Boolean, Object, MembershipCreateStatus) CreateUser(String, String, String, String, String, Boolean, Object, MembershipCreateStatus) CreateUser(String, String, String, String, String, Boolean, Object, MembershipCreateStatus) CreateUser(String, String, String, String, String, Boolean, Object, MembershipCreateStatus)

Adds a new membership user to the data source.

DecryptPassword(Byte[]) DecryptPassword(Byte[]) DecryptPassword(Byte[]) DecryptPassword(Byte[])

Decrypts an encrypted password.

DeleteUser(String, Boolean) DeleteUser(String, Boolean) DeleteUser(String, Boolean) DeleteUser(String, Boolean)

Removes a user from the membership data source.

EncryptPassword(Byte[]) EncryptPassword(Byte[]) EncryptPassword(Byte[]) EncryptPassword(Byte[])

Encrypts a password.

EncryptPassword(Byte[], MembershipPasswordCompatibilityMode) EncryptPassword(Byte[], MembershipPasswordCompatibilityMode) EncryptPassword(Byte[], MembershipPasswordCompatibilityMode) EncryptPassword(Byte[], MembershipPasswordCompatibilityMode)

Encrypts the specified password using the specified password-compatibility mode.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
FindUsersByEmail(String, Int32, Int32, Int32) FindUsersByEmail(String, Int32, Int32, Int32) FindUsersByEmail(String, Int32, Int32, Int32) FindUsersByEmail(String, Int32, Int32, Int32)

Gets a collection of membership users where the email address contains the specified email address to match.

FindUsersByName(String, Int32, Int32, Int32) FindUsersByName(String, Int32, Int32, Int32) FindUsersByName(String, Int32, Int32, Int32) FindUsersByName(String, Int32, Int32, Int32)

Gets a collection of membership users where the user name contains the specified user name to match.

GetAllUsers(Int32, Int32, Int32) GetAllUsers(Int32, Int32, Int32) GetAllUsers(Int32, Int32, Int32) GetAllUsers(Int32, Int32, Int32)

Gets a collection of all the users in the data source in pages of data.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetNumberOfUsersOnline() GetNumberOfUsersOnline() GetNumberOfUsersOnline() GetNumberOfUsersOnline()

Gets the number of users currently accessing the application.

GetPassword(String, String) GetPassword(String, String) GetPassword(String, String) GetPassword(String, String)

Gets the password for the specified user name from the data source.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetUser(Object, Boolean) GetUser(Object, Boolean) GetUser(Object, Boolean) GetUser(Object, Boolean)

Gets user information from the data source based on the unique identifier for the membership user. Provides an option to update the last-activity date/time stamp for the user.

GetUser(String, Boolean) GetUser(String, Boolean) GetUser(String, Boolean) GetUser(String, Boolean)

Gets information from the data source for a user. Provides an option to update the last-activity date/time stamp for the user.

GetUserNameByEmail(String) GetUserNameByEmail(String) GetUserNameByEmail(String) GetUserNameByEmail(String)

Gets the user name associated with the specified email address.

Initialize(String, NameValueCollection) Initialize(String, NameValueCollection) Initialize(String, NameValueCollection) Initialize(String, NameValueCollection)

Initializes the configuration builder.

(Inherited from ProviderBase)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnValidatingPassword(ValidatePasswordEventArgs) OnValidatingPassword(ValidatePasswordEventArgs) OnValidatingPassword(ValidatePasswordEventArgs) OnValidatingPassword(ValidatePasswordEventArgs)

Raises the ValidatingPassword event if an event handler has been defined.

ResetPassword(String, String) ResetPassword(String, String) ResetPassword(String, String) ResetPassword(String, String)

Resets a user's password to a new, automatically generated password.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
UnlockUser(String) UnlockUser(String) UnlockUser(String) UnlockUser(String)

Clears a lock so that the membership user can be validated.

UpdateUser(MembershipUser) UpdateUser(MembershipUser) UpdateUser(MembershipUser) UpdateUser(MembershipUser)

Updates information about a user in the data source.

ValidateUser(String, String) ValidateUser(String, String) ValidateUser(String, String) ValidateUser(String, String)

Verifies that the specified user name and password exist in the data source.

Events

ValidatingPassword ValidatingPassword ValidatingPassword ValidatingPassword

Occurs when a user is created, a password is changed, or a password is reset.

Applies to

See Also