Export (0) Print
Expand All

SimpleMembershipProvider Class

Provides support for website membership tasks, such as creating accounts, deleting accounts, and managing passwords.

Namespace:  WebMatrix.WebData
Assembly:  WebMatrix.WebData (in WebMatrix.WebData.dll)

public class SimpleMembershipProvider : ExtendedMembershipProvider

The SimpleMembershipProvider type exposes the following members.

  NameDescription
Public methodSimpleMembershipProvider()Initializes a new instance of the SimpleMembershipProvider class.
Public methodSimpleMembershipProvider(MembershipProvider)Initializes a new instance of the SimpleMembershipProvider class by using the specified membership provider.
Top

  NameDescription
Public propertyApplicationNameGets or sets the name of the application. (Overrides MembershipProvider.ApplicationName.)
Public propertyCasingBehaviorGets or sets the SimpleMembershipProviderCasingBehavior for this provider.
Public propertyDescription (Inherited from ProviderBase.)
Public propertyEnablePasswordResetGets a value that indicates whether the membership provider lets users reset their passwords. (Overrides MembershipProvider.EnablePasswordReset.)
Public propertyEnablePasswordRetrievalGets a value that indicates whether the membership provider lets users retrieve their passwords. (Overrides MembershipProvider.EnablePasswordRetrieval.)
Public propertyMaxInvalidPasswordAttemptsGets the number of invalid password or password-answer attempts that are allowed before the membership user is locked out. (Overrides MembershipProvider.MaxInvalidPasswordAttempts.)
Public propertyMinRequiredNonAlphanumericCharactersGets the minimum number of special (non-alphanumeric) characters that a password must contain. (Overrides MembershipProvider.MinRequiredNonAlphanumericCharacters.)
Public propertyMinRequiredPasswordLengthGets the minimum length that is required for a password. (Overrides MembershipProvider.MinRequiredPasswordLength.)
Public propertyName (Inherited from ProviderBase.)
Public propertyPasswordAttemptWindowGets the number of minutes during which the maximum number of invalid password or security-question answer attempts are allowed before the user account is locked out. (Overrides MembershipProvider.PasswordAttemptWindow.)
Public propertyPasswordFormatGets a value that indicates the format for storing passwords. (Overrides MembershipProvider.PasswordFormat.)
Public propertyPasswordStrengthRegularExpressionGets the regular expression that is used to evaluate password complexity. (Overrides MembershipProvider.PasswordStrengthRegularExpression.)
Public propertyRequiresQuestionAndAnswerGets a value that indicates whether the membership provider requires that the user answer a security question for password reset and retrieval. (Overrides MembershipProvider.RequiresQuestionAndAnswer.)
Public propertyRequiresUniqueEmailGets a value that indicates whether the membership provider requires a unique email address for each user name. (Overrides MembershipProvider.RequiresUniqueEmail.)
Public propertyUserIdColumnGets or sets the name of the database column that contains user IDs.
Public propertyUserNameColumnGets or sets the name of the database column that contains user names.
Public propertyUserTableNameGets or sets the name of the database table that contains user information.
Top

  NameDescription
Public methodChangePasswordChanges the password for the specified membership account. (Overrides MembershipProvider.ChangePassword(String, String, String).)
Public methodChangePasswordQuestionAndAnswerChanges the password question and answer for the specified account. (Overrides MembershipProvider.ChangePasswordQuestionAndAnswer(String, String, String, String).)
Public methodConfirmAccount(String)Activates a pending membership account. (Overrides ExtendedMembershipProvider.ConfirmAccount(String).)
Public methodConfirmAccount(String, String)Indicates whether the user account is confirmed. (Overrides ExtendedMembershipProvider.ConfirmAccount(String, String).)
Public methodCreateAccount(String, String)Creates a new user account using the specified user name and password. (Inherited from ExtendedMembershipProvider.)
Public methodCreateAccount(String, String, Boolean)Creates a new user account by using the specified user name and password. (Overrides ExtendedMembershipProvider.CreateAccount(String, String, Boolean).)
Public methodCreateOrUpdateOAuthAccountCreates a new OAuth membership account, or updates an existing OAuth Membership account. (Overrides ExtendedMembershipProvider.CreateOrUpdateOAuthAccount(String, String, String).)
Public methodCreateUserAdds the specified user to the membership database. (Overrides MembershipProvider.CreateUser(String, String, String, String, String, Boolean, Object, MembershipCreateStatus).)
Public methodCreateUserAndAccount(String, String)Creates a new user profile and a new membership account. (Inherited from ExtendedMembershipProvider.)
Public methodCreateUserAndAccount(String, String, Boolean)Creates a new user profile and a new membership account. (Inherited from ExtendedMembershipProvider.)
Public methodCreateUserAndAccount(String, String, IDictionary<String, Object>)When overridden in a derived class, creates a new user profile and a new membership account. (Inherited from ExtendedMembershipProvider.)
Public methodCreateUserAndAccount(String, String, Boolean, IDictionary<String, Object>)Creates a new user profile and a new membership account. (Overrides ExtendedMembershipProvider.CreateUserAndAccount(String, String, Boolean, IDictionary<String, Object>).)
Protected methodDecryptPassword (Inherited from MembershipProvider.)
Public methodDeleteAccountDeletes the specified membership account. (Overrides ExtendedMembershipProvider.DeleteAccount(String).)
Public methodDeleteOAuthAccountDeletes the OAuth or OpenID account with the specified provider name and provider user ID. (Overrides ExtendedMembershipProvider.DeleteOAuthAccount(String, String).)
Public methodDeleteOAuthTokenDeletes the specified OAuth token. (Overrides ExtendedMembershipProvider.DeleteOAuthToken(String).)
Public methodDeleteUserDeletes the specified user account, and optionally deletes all profile data that is related to that user account. (Overrides MembershipProvider.DeleteUser(String, Boolean).)
Protected methodEncryptPassword(Byte[]) (Inherited from MembershipProvider.)
Protected methodEncryptPassword(Byte[], MembershipPasswordCompatibilityMode) (Inherited from MembershipProvider.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodFindUsersByEmailReturns all of the user accounts whose email address matches the specified email address. (Overrides MembershipProvider.FindUsersByEmail(String, Int32, Int32, Int32).)
Public methodFindUsersByNameReturns all of the user accounts whose name matches the specified user name. (Overrides MembershipProvider.FindUsersByName(String, Int32, Int32, Int32).)
Public methodGeneratePasswordResetToken(String)Generates a password reset token that can be sent to a user in email. (Inherited from ExtendedMembershipProvider.)
Public methodGeneratePasswordResetToken(String, Int32)Generates a password reset token that can be sent to a user in email. (Overrides ExtendedMembershipProvider.GeneratePasswordResetToken(String, Int32).)
Public methodGetAccountsForUserReturns all OAuth membership accounts that are associated with the specified user name. (Overrides ExtendedMembershipProvider.GetAccountsForUser(String).)
Public methodGetAllUsersReturns all of the user accounts in the data source. (Overrides MembershipProvider.GetAllUsers(Int32, Int32, Int32).)
Public methodGetCreateDateReturns the date and time when the specified user account was created. (Overrides ExtendedMembershipProvider.GetCreateDate(String).)
Public methodGetHashCode (Inherited from Object.)
Public methodGetLastPasswordFailureDateReturns the date and time when an incorrect password was most recently entered for the specified user account. (Overrides ExtendedMembershipProvider.GetLastPasswordFailureDate(String).)
Public methodGetNumberOfUsersOnlineReturns the number of users who are currently accessing the application. (Overrides MembershipProvider.GetNumberOfUsersOnline().)
Public methodGetOAuthTokenSecretReturns the OAuth token secret. (Overrides ExtendedMembershipProvider.GetOAuthTokenSecret(String).)
Public methodGetPasswordReturns the password for the specified user account from the data source. (Overrides MembershipProvider.GetPassword(String, String).)
Public methodGetPasswordChangedDateReturns the date and time when the password was most recently changed for the specified membership account. (Overrides ExtendedMembershipProvider.GetPasswordChangedDate(String).)
Public methodGetPasswordFailuresSinceLastSuccessReturns the number of times that the password for the specified user account was incorrectly entered since the most recent successful login or since the user account was created. (Overrides ExtendedMembershipProvider.GetPasswordFailuresSinceLastSuccess(String).)
Public methodGetType (Inherited from Object.)
Public methodGetUser(Object, Boolean)Returns information about the user account using the specified user ID, and optionally updates the timestamp of the most recent activity for the user account. (Overrides MembershipProvider.GetUser(Object, Boolean).)
Public methodGetUser(String, Boolean)Returns information about the user account using the specified user name, and optionally updates the timestamp of the most recent activity for the user account. (Overrides MembershipProvider.GetUser(String, Boolean).)
Public methodGetUserIdReturns the ID for a user based on the specified user name.
Public methodGetUserIdFromOAuthReturns the user ID for the specified OAuth or OpenID provider and provider user ID. (Overrides ExtendedMembershipProvider.GetUserIdFromOAuth(String, String).)
Public methodGetUserIdFromPasswordResetTokenReturns the ID for a user based on a password reset token. (Overrides ExtendedMembershipProvider.GetUserIdFromPasswordResetToken(String).)
Public methodGetUserNameByEmailReturns the user name that is associated with the specified email address. (Overrides MembershipProvider.GetUserNameByEmail(String).)
Public methodGetUserNameFromIdReturns the user name that is associated with the specified user ID. (Overrides ExtendedMembershipProvider.GetUserNameFromId(Int32).)
Public methodHasLocalAccountIndicates whether the user has local account. (Overrides ExtendedMembershipProvider.HasLocalAccount(Int32).)
Public methodInitializeInitializes the provider. (Overrides ProviderBase.Initialize(String, NameValueCollection).)
Public methodIsConfirmedReturns a value that indicates whether the user account has been confirmed by the provider. (Overrides ExtendedMembershipProvider.IsConfirmed(String).)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnValidatingPassword (Inherited from MembershipProvider.)
Public methodReplaceOAuthRequestTokenWithAccessTokenReplaces OAuth request token with access token. (Overrides ExtendedMembershipProvider.ReplaceOAuthRequestTokenWithAccessToken(String, String, String).)
Public methodResetPasswordResets the password for a user account to a new, automatically generated password. (Overrides MembershipProvider.ResetPassword(String, String).)
Public methodResetPasswordWithTokenResets a password after verifying that the specified password reset token is valid. (Overrides ExtendedMembershipProvider.ResetPasswordWithToken(String, String).)
Public methodStoreOAuthRequestTokenStores an OAuth request token. (Overrides ExtendedMembershipProvider.StoreOAuthRequestToken(String, String).)
Public methodToString (Inherited from Object.)
Public methodUnlockUserUnlocks a user account so that the membership user can be validated. (Overrides MembershipProvider.UnlockUser(String).)
Public methodUpdateUserUpdates user information. (Overrides MembershipProvider.UpdateUser(MembershipUser).)
Public methodValidateUserVerifies that the specified user account and password exist. (Overrides MembershipProvider.ValidateUser(String, String).)
Top

  NameDescription
Public eventValidatingPassword (Inherited from MembershipProvider.)
Top

The WebSecurity helper class is the recommended way to manage user (membership) accounts, passwords, and other membership tasks. The SimpleMembershipProvider class can manage membership tasks; however, it is not recommended because WebSecurity provides a simpler way to implement membership. The SimpleMembershipProvider class is intended for developers who require more precise control over the membership process.

In ASP.NET Web Pages sites, you can access the functionality of the SimpleMembershipProvider class by using the Membership property of a web page. You do not (in fact, cannot) initialize a new instance of the SimpleMembershipProvider class.

By design, the SimpleMembershipProvider class does not implement the full range of functionality that is possible in ASP.NET membership providers, as defined in the MembershipProvider class that is used by all ASP.NET membership providers. Some members are available in the class because they are inherited from the base class, but will throw an exception if you access them.

If your website requires the full membership provider capabilities, you can skip initialization of the Web Pages membership system (that is, do not call WebSecurity.InitializeDatabaseConnection()) and instead make sure that the standard membership and role providers are enabled. In that case, calls that you make to the SimpleMembershipProvider class are passed through to the standard provider (which is referred to as the previous provider in the SimpleMembershipProvider class documentation). For more information, see Configuring an ASP.NET Application to Use Membership.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft