C# Класс Microsoft.WindowsAzure.Samples.Storage.Providers.TableStorageMembershipProvider

Наследование: System.Web.Security.MembershipProvider
Показать файл Открыть проект

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

ChangePassword() публичный Метод

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
Результат bool

ChangePasswordQuestionAndAnswer() публичный Метод

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
Результат bool

CreateUser() публичный Метод

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
Результат System.Web.Security.MembershipUser

DeleteUser() публичный Метод

Deletes the user from the membership table. This implementation ignores the deleteAllRelatedData argument
public DeleteUser ( string username, bool deleteAllRelatedData ) : bool
username string
deleteAllRelatedData bool
Результат bool

FindUsersByName() публичный Метод

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
Результат System.Web.Security.MembershipUserCollection

GeneratePassword() публичный Метод

public GeneratePassword ( ) : string
Результат string

GetAllUsers() публичный Метод

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
Результат System.Web.Security.MembershipUserCollection

GetNumberOfUsersOnline() публичный Метод

Get the number of users that are currently online
public GetNumberOfUsersOnline ( ) : int
Результат int

GetPassword() публичный Метод

Gets the password of a user given the provided password answer
public GetPassword ( string username, string answer ) : string
username string
answer string
Результат string

GetUser() публичный Метод

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
Результат System.Web.Security.MembershipUser

GetUser() публичный Метод

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
Результат System.Web.Security.MembershipUser

GetUserNameByEmail() публичный Метод

Retrieves a username based on a matching email.
public GetUserNameByEmail ( string email ) : string
email string
Результат string

Initialize() публичный Метод

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
Результат void

ResetPassword() публичный Метод

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
Результат string

UnlockUser() публичный Метод

Unlock a user
public UnlockUser ( string userName ) : bool
userName string
Результат bool

ValidateUser() публичный Метод

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
Результат bool