C# Class Microsoft.WindowsAzure.Samples.Storage.Providers.TableStorageMembershipProvider

Inheritance: System.Web.Security.MembershipProvider
Afficher le fichier Open project: WindowsAzure-Toolkits/wa-toolkit-wp-nugets

Méthodes publiques

Méthode Description
ChangePassword ( string username, string oldPassword, string newPassword ) : bool

Changes a users password. We don't use retries in this highly security-related function. All errors are exposed to the user of this function.

ChangePasswordQuestionAndAnswer ( string username, string password, string newPasswordQuestion, string newPasswordAnswer ) : bool

Change the password answer for a user.

CreateUser ( string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, MembershipCreateStatus &status ) : System.Web.Security.MembershipUser

Creates a new user and stores it in the membership table. We do not use retry policies in this highly security-related function. All error conditions are directly exposed to the user.

DeleteUser ( string username, bool deleteAllRelatedData ) : bool

Deletes the user from the membership table. This implementation ignores the deleteAllRelatedData argument

FindUsersByName ( string usernameToMatch, int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection

Find users by their names. The usernameToMatch must be the complete username like frank or can contain a '%' character at the end. A '%' character at the end implies that arbitrary characters can follow. Supporting additional searches right now would be very expensive because the filtering would have to be done on the client side; i.e., all users would have to be retrieved in order to do the filtering. IMPORTANT: because of this decision, user names must not contain a % character when using this function.

GeneratePassword ( ) : string
GetAllUsers ( int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection

Retrieves a collection of all the users.

GetNumberOfUsersOnline ( ) : int

Get the number of users that are currently online

GetPassword ( string username, string answer ) : string

Gets the password of a user given the provided password answer

GetUser ( object providerUserKey, bool userIsOnline ) : System.Web.Security.MembershipUser

Get a user based on the username parameter. If the userIsOnline parameter is set the lastActivity flag of the user is changed in the data store

GetUser ( string username, bool userIsOnline ) : System.Web.Security.MembershipUser

Retrieves a user based on his/her username. The userIsOnline parameter determines whether to update the lastActivityDate of the user in the data store

GetUserNameByEmail ( string email ) : string

Retrieves a username based on a matching email.

Initialize ( string name, NameValueCollection config ) : void

Initializes the membership provider. This is the only function that cannot be accessed in parallel by multiple applications. The function reads the properties of the provider specified in the Web.config file and stores them in member variables.

ResetPassword ( string username, string answer ) : string

Reset the password of a user. No retry policies are used in this function.

UnlockUser ( string userName ) : bool

Unlock a user

ValidateUser ( string username, string password ) : bool

Returns true if the username and password match an exsisting user. This implementation does not update a user's login time and does not raise corresponding Web events

Private Methods

Méthode Description
CheckPassword ( DataServiceContext svc, string username, string password, bool updateLastLoginActivityDate, bool failIfNotApproved, MembershipRow &member ) : bool
CheckPassword ( string username, string password, bool updateLastLoginActivityDate, bool failIfNotApproved ) : bool
CheckPassword ( string username, string password, bool updateLastLoginActivityDate, bool failIfNotApproved, MembershipRow &member ) : bool
CreateDataServiceContext ( ) : Microsoft.WindowsAzure.StorageClient.TableServiceContext
EncodePassword ( string pass, int passwordFormat, string salt ) : string
EvaluatePasswordRequirements ( string password ) : bool
FindUsersByEmail ( string emailToMatch, int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection
GenerateSalt ( ) : string
GetUserFromTable ( DataServiceContext svc, string username ) : MembershipRow
IsUniqueEmail ( string email ) : bool
IsUniqueEmail ( string email, MembershipRow &member ) : bool
IsUniqueUserName ( string userName ) : bool
PasswordAttemptWindowAsTimeSpan ( ) : TimeSpan
ProcessGetUserQuery ( TableServiceContext svc, IQueryable query, bool updateLastActivityDate ) : MembershipUser
UnEncodePassword ( string pass, int passwordFormat ) : string
UpdateUser ( MembershipUser updatedUser ) : void

Method Details

ChangePassword() public méthode

Changes a users password. We don't use retries in this highly security-related function. All errors are exposed to the user of this function.
public ChangePassword ( string username, string oldPassword, string newPassword ) : bool
username string
oldPassword string
newPassword string
Résultat bool

ChangePasswordQuestionAndAnswer() public méthode

Change the password answer for a user.
public ChangePasswordQuestionAndAnswer ( string username, string password, string newPasswordQuestion, string newPasswordAnswer ) : bool
username string
password string
newPasswordQuestion string
newPasswordAnswer string
Résultat bool

CreateUser() public méthode

Creates a new user and stores it in the membership table. We do not use retry policies in this highly security-related function. All error conditions are directly exposed to the user.
public CreateUser ( string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, MembershipCreateStatus &status ) : System.Web.Security.MembershipUser
username string
password string
email string
passwordQuestion string
passwordAnswer string
isApproved bool
providerUserKey object
status MembershipCreateStatus
Résultat System.Web.Security.MembershipUser

DeleteUser() public méthode

Deletes the user from the membership table. This implementation ignores the deleteAllRelatedData argument
public DeleteUser ( string username, bool deleteAllRelatedData ) : bool
username string
deleteAllRelatedData bool
Résultat bool

FindUsersByName() public méthode

Find users by their names. The usernameToMatch must be the complete username like frank or can contain a '%' character at the end. A '%' character at the end implies that arbitrary characters can follow. Supporting additional searches right now would be very expensive because the filtering would have to be done on the client side; i.e., all users would have to be retrieved in order to do the filtering. IMPORTANT: because of this decision, user names must not contain a % character when using this function.
public FindUsersByName ( string usernameToMatch, int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection
usernameToMatch string
pageIndex int
pageSize int
totalRecords int
Résultat System.Web.Security.MembershipUserCollection

GeneratePassword() public méthode

public GeneratePassword ( ) : string
Résultat string

GetAllUsers() public méthode

Retrieves a collection of all the users.
public GetAllUsers ( int pageIndex, int pageSize, int &totalRecords ) : System.Web.Security.MembershipUserCollection
pageIndex int
pageSize int
totalRecords int
Résultat System.Web.Security.MembershipUserCollection

GetNumberOfUsersOnline() public méthode

Get the number of users that are currently online
public GetNumberOfUsersOnline ( ) : int
Résultat int

GetPassword() public méthode

Gets the password of a user given the provided password answer
public GetPassword ( string username, string answer ) : string
username string
answer string
Résultat string

GetUser() public méthode

Get a user based on the username parameter. If the userIsOnline parameter is set the lastActivity flag of the user is changed in the data store
public GetUser ( object providerUserKey, bool userIsOnline ) : System.Web.Security.MembershipUser
providerUserKey object
userIsOnline bool
Résultat System.Web.Security.MembershipUser

GetUser() public méthode

Retrieves a user based on his/her username. The userIsOnline parameter determines whether to update the lastActivityDate of the user in the data store
public GetUser ( string username, bool userIsOnline ) : System.Web.Security.MembershipUser
username string
userIsOnline bool
Résultat System.Web.Security.MembershipUser

GetUserNameByEmail() public méthode

Retrieves a username based on a matching email.
public GetUserNameByEmail ( string email ) : string
email string
Résultat string

Initialize() public méthode

Initializes the membership provider. This is the only function that cannot be accessed in parallel by multiple applications. The function reads the properties of the provider specified in the Web.config file and stores them in member variables.
public Initialize ( string name, NameValueCollection config ) : void
name string
config System.Collections.Specialized.NameValueCollection
Résultat void

ResetPassword() public méthode

Reset the password of a user. No retry policies are used in this function.
public ResetPassword ( string username, string answer ) : string
username string
answer string
Résultat string

UnlockUser() public méthode

Unlock a user
public UnlockUser ( string userName ) : bool
userName string
Résultat bool

ValidateUser() public méthode

Returns true if the username and password match an exsisting user. This implementation does not update a user's login time and does not raise corresponding Web events
public ValidateUser ( string username, string password ) : bool
username string
password string
Résultat bool