C# 클래스 Nancy.Security.MembershipProvider

Specialized MembershipProvider that uses a file (Users.config) to store its data. Passwords for the users are always stored as a salted hash (see: http://msdn.microsoft.com/msdnmag/issues/03/08/SecurityBriefs/)
상속: IUserMapper
파일 보기 프로젝트 열기: GestUAB/GestUAB

공개 메소드들

메소드 설명
ChangePassword ( string username, string oldPassword, string newPassword ) : bool

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

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

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

ConfirmAccount ( string accountConfirmationToken ) : bool

Activates a pending membership account.

ConfirmAccount ( string userName, string accountConfirmationToken ) : bool

Indicates whether the user account is confirmed.

CreateAccount ( string userName, string password ) : string

Creates a new user account using the specified user name and password.

CreateAccount ( string userName, string password, bool requireConfirmationToken = false ) : string

Creates the account.

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

Adds a new membership user to the data source.

DeleteUser ( string username, bool deleteAllRelatedData ) : bool

Removes a user from the membership data source.

FindUsersByEmail ( string emailToMatch, int pageIndex, int pageSize, int &totalRecords ) : IEnumerable

Gets a collection of membership users where the e-mail address contains the specified e-mail address to match.

FindUsersByName ( string usernameToMatch, int pageIndex, int pageSize, int &totalRecords ) : IEnumerable

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

GetAllUsers ( int pageIndex, int pageSize, int &totalRecords ) : IEnumerable

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

GetNumberOfUsersOnline ( ) : int

Gets the number of users currently accessing the application.

GetPassword ( string username, string answer ) : string

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

GetUser ( System.Guid userId, bool userIsOnline ) : MembershipUser

Gets information from the data source for a user 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 username, bool userIsOnline ) : MembershipUser

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

GetUserFromIdentifier ( System.Guid identifier, Nancy.NancyContext context ) : IUserIdentity
GetUserNameByEmail ( string email ) : string

Gets the user name associated with the specified e-mail address.

ResetPassword ( string username, string answer ) : string

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

UnlockUser ( string userName ) : bool

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

UpdateUser ( MembershipUser user ) : void

Updates information about a user in the data source.

ValidateUser ( string username, string password ) : Guid?

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

보호된 메소드들

메소드 설명
DecryptPassword ( byte encodedPassword ) : byte[]

Decrypts an encrypted password.

EncryptPassword ( byte password ) : byte[]

Encrypts a password.

OnValidatingPassword ( ValidatePasswordEventArgs args ) : void

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

메소드 상세

ChangePassword() 공개 추상적인 메소드

Processes a request to update the password for a membership user.
public abstract ChangePassword ( string username, string oldPassword, string newPassword ) : bool
username string The user to update the password for.
oldPassword string The current password for the specified user.
newPassword string The new password for the specified user.
리턴 bool

ChangePasswordQuestionAndAnswer() 공개 추상적인 메소드

Processes a request to update the password question and answer for a membership user.
public abstract ChangePasswordQuestionAndAnswer ( string username, string password, string newPasswordQuestion, string newPasswordAnswer ) : bool
username string The user to change the password question and answer for.
password string The password for the specified user.
newPasswordQuestion string The new password question for the specified user.
newPasswordAnswer string The new password answer for the specified user.
리턴 bool

ConfirmAccount() 공개 추상적인 메소드

Activates a pending membership account.
public abstract ConfirmAccount ( string accountConfirmationToken ) : bool
accountConfirmationToken string /// A confirmation token to pass to the authentication provider. ///
리턴 bool

ConfirmAccount() 공개 추상적인 메소드

Indicates whether the user account is confirmed.
public abstract ConfirmAccount ( string userName, string accountConfirmationToken ) : bool
userName string /// The username. ///
accountConfirmationToken string /// The account confirmation. ///
리턴 bool

CreateAccount() 공개 추상적인 메소드

Creates a new user account using the specified user name and password.
public abstract CreateAccount ( string userName, string password ) : string
userName string
password string
리턴 string

CreateAccount() 공개 추상적인 메소드

Creates the account.
public abstract CreateAccount ( string userName, string password, bool requireConfirmationToken = false ) : string
userName string /// The user name. ///
password string /// The password. ///
requireConfirmationToken bool /// (Optional) true to specify that the user account must be confirmed; otherwise, false. The default is false. ///
리턴 string

CreateUser() 공개 추상적인 메소드

Adds a new membership user to the data source.
public abstract CreateUser ( string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, System.Guid providerUserKey, MembershipCreateStatus &status ) : MembershipUser
username string The user name for the new user.
password string The password for the new user.
email string The e-mail address for the new user.
passwordQuestion string The password question for the new user.
passwordAnswer string The password answer for the new user
isApproved bool Whether or not the new user is approved to be validated.
providerUserKey System.Guid The unique identifier from the membership data source for the user.
status MembershipCreateStatus A enumeration value indicating whether the user was created successfully.
리턴 MembershipUser

DecryptPassword() 보호된 메소드

Decrypts an encrypted password.
protected DecryptPassword ( byte encodedPassword ) : byte[]
encodedPassword byte /// A byte array that contains the encrypted password to decrypt. ///
리턴 byte[]

DeleteUser() 공개 추상적인 메소드

Removes a user from the membership data source.
public abstract DeleteUser ( string username, bool deleteAllRelatedData ) : bool
username string The name of the user to delete.
deleteAllRelatedData bool true to delete data related to the user from the database; false to leave data related to the user in the database.
리턴 bool

EncryptPassword() 보호된 메소드

Encrypts a password.
protected EncryptPassword ( byte password ) : byte[]
password byte /// A byte array that contains the password to encrypt. ///
리턴 byte[]

FindUsersByEmail() 공개 추상적인 메소드

Gets a collection of membership users where the e-mail address contains the specified e-mail address to match.
public abstract FindUsersByEmail ( string emailToMatch, int pageIndex, int pageSize, int &totalRecords ) : IEnumerable
emailToMatch string The e-mail address to search for.
pageIndex int The index of the page of results to return. pageIndex is zero-based.
pageSize int The size of the page of results to return.
totalRecords int The total number of matched users.
리턴 IEnumerable

FindUsersByName() 공개 추상적인 메소드

Gets a collection of membership users where the user name contains the specified user name to match.
public abstract FindUsersByName ( string usernameToMatch, int pageIndex, int pageSize, int &totalRecords ) : IEnumerable
usernameToMatch string The user name to search for.
pageIndex int The index of the page of results to return. pageIndex is zero-based.
pageSize int The size of the page of results to return.
totalRecords int The total number of matched users.
리턴 IEnumerable

GetAllUsers() 공개 추상적인 메소드

Gets a collection of all the users in the data source in pages of data.
public abstract GetAllUsers ( int pageIndex, int pageSize, int &totalRecords ) : IEnumerable
pageIndex int The index of the page of results to return. pageIndex is zero-based.
pageSize int The size of the page of results to return.
totalRecords int The total number of matched users.
리턴 IEnumerable

GetNumberOfUsersOnline() 공개 추상적인 메소드

Gets the number of users currently accessing the application.
public abstract GetNumberOfUsersOnline ( ) : int
리턴 int

GetPassword() 공개 추상적인 메소드

Gets the password for the specified user name from the data source.
public abstract GetPassword ( string username, string answer ) : string
username string The user to retrieve the password for.
answer string The password answer for the user.
리턴 string

GetUser() 공개 추상적인 메소드

Gets information from the data source for a user based on the unique identifier for the membership user. Provides an option to update the last-activity date/time stamp for the user.
public abstract GetUser ( System.Guid userId, bool userIsOnline ) : MembershipUser
userId System.Guid
userIsOnline bool true to update the last-activity date/time stamp for the user; false to return user information without updating the last-activity date/time stamp for the user.
리턴 MembershipUser

GetUser() 공개 추상적인 메소드

Gets information from the data source for a user. Provides an option to update the last-activity date/time stamp for the user.
public abstract GetUser ( string username, bool userIsOnline ) : MembershipUser
username string The name of the user to get information for.
userIsOnline bool true to update the last-activity date/time stamp for the user; false to return user information without updating the last-activity date/time stamp for the user.
리턴 MembershipUser

GetUserFromIdentifier() 공개 추상적인 메소드

public abstract GetUserFromIdentifier ( System.Guid identifier, Nancy.NancyContext context ) : IUserIdentity
identifier System.Guid
context Nancy.NancyContext
리턴 IUserIdentity

GetUserNameByEmail() 공개 추상적인 메소드

Gets the user name associated with the specified e-mail address.
public abstract GetUserNameByEmail ( string email ) : string
email string The e-mail address to search for.
리턴 string

OnValidatingPassword() 보호된 메소드

Raises the ValidatingPassword event if an event handler has been defined.
protected OnValidatingPassword ( ValidatePasswordEventArgs args ) : void
args ValidatePasswordEventArgs /// The ValidatePasswordEventArgs to pass to the ValidatingPassword event handler. ///
리턴 void

ResetPassword() 공개 추상적인 메소드

Resets a user's password to a new, automatically generated password.
public abstract ResetPassword ( string username, string answer ) : string
username string The user to reset the password for.
answer string The password answer for the specified user.
리턴 string

UnlockUser() 공개 추상적인 메소드

Clears a lock so that the membership user can be validated.
public abstract UnlockUser ( string userName ) : bool
userName string The membership user to clear the lock status for.
리턴 bool

UpdateUser() 공개 추상적인 메소드

Updates information about a user in the data source.
public abstract UpdateUser ( MembershipUser user ) : void
user MembershipUser A object that represents the user to update and the updated information for the user.
리턴 void

ValidateUser() 공개 추상적인 메소드

Verifies that the specified user name and password exist in the data source.
public abstract ValidateUser ( string username, string password ) : Guid?
username string The name of the user to validate.
password string The password for the specified user.
리턴 Guid?