WebSecurity Methods

The WebSecurity type exposes the following members.

  NameDescription
Public method Static member ChangePassword Changes the password for the specified user.
Public method Static member ConfirmAccount(String) Confirms that an account is valid and activates the account.
Public method Static member ConfirmAccount(String, String) Confirms that an account for the specified user name is valid and activates the account.
Public method Static member CreateAccount Creates a new membership account using the specified user name and password and optionally lets you specify that the user must explicitly confirm the account.
Public method Static member CreateUserAndAccount Creates a new user profile entry and a new membership account.
Public method Static member GeneratePasswordResetToken Generates a password reset token that can be sent to a user in email.
Public method Static member GetCreateDate Returns the date and time when the specified membership account was created.
Public method Static member GetLastPasswordFailureDate Returns the date and time when an incorrect password was most recently entered for the specified account.
Public method Static member GetPasswordChangedDate Returns the date and time when the password was most recently changed for the specified membership account.
Public method Static member GetPasswordFailuresSinceLastSuccess Returns the number of times that the password for the specified account was incorrectly entered since the last successful login or since the membership account was created.
Public method Static member GetUserId Returns the ID for a user based on the specified user name.
Public method Static member GetUserIdFromPasswordResetToken Returns a user ID from a password reset token.
Public method Static member InitializeDatabaseConnection(String, String, String, String, Boolean) Initializes the membership system by connecting to a database that contains user information and optionally creates membership tables if they do not already exist.
Public method Static member InitializeDatabaseConnection(String, String, String, String, Boolean, SimpleMembershipProviderCasingBehavior)
Public method Static member InitializeDatabaseConnection(String, String, String, String, String, Boolean) Initializes the membership system by connecting to a database that contains user information by using the specified membership or role provider, and optionally creates membership tables if they do not already exist.
Public method Static member InitializeDatabaseConnection(String, String, String, String, String, Boolean, SimpleMembershipProviderCasingBehavior)
Public method Static member IsAccountLockedOut(String, Int32, Int32) Returns a value that indicates whether the specified membership account is temporarily locked because of too many failed password attempts in the specified number of seconds.
Public method Static member IsAccountLockedOut(String, Int32, TimeSpan) Returns a value that indicates whether the specified membership account is temporarily locked because of too many failed password attempts in the specified time span.
Public method Static member IsConfirmed Returns a value that indicates whether the user has been confirmed.
Public method Static member IsCurrentUser Returns a value that indicates whether the user name of the logged-in user matches the specified user name.
Public method Static member Login Logs the user in.
Public method Static member Logout Logs the user out.
Public method Static member RequireAuthenticatedUser If the user is not authenticated, sets the HTTP status to 401 (Unauthorized).
Public method Static member RequireRoles If the current user is not in all of the specified roles, sets the HTTP status code to 401 (Unauthorized).
Public method Static member RequireUser(Int32) If the specified user is not logged on, sets the HTTP status to 401 (Unauthorized).
Public method Static member RequireUser(String) If the current user does not match the specified user name, sets the HTTP status to 401 (Unauthorized).
Public method Static member ResetPassword Resets a password by using a password reset token.
Public method Static member UserExists Returns a value that indicates whether the specified user exists in the membership database.
Top
Show: