UserManager<TUser> Class

 

Represents the user manager for users where the primary key for the user is of type string.

Namespace:   Microsoft.AspNet.Identity
Assembly:  Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)

Inheritance Hierarchy

System.Object
  Microsoft.AspNet.Identity.UserManager<TUser, TKey>
    Microsoft.AspNet.Identity.UserManager<TUser>

Syntax

public class UserManager<TUser> : UserManager<TUser, string>
where TUser : class, IUser<string>
generic<typename TUser>
where TUser : ref class, IUser<String^>
public ref class UserManager : UserManager<TUser, String^>
type UserManager<'TUser when 'TUser : not struct and IUser<string>> = 
    class
        inherit UserManager<'TUser, string>
    end
Public Class UserManager(Of TUser As { Class, IUser(Of String) })
    Inherits UserManager(Of TUser, String)

Type Parameters

  • TUser
    The type of the user.

Constructors

Name Description
System_CAPS_pubmethod UserManager<TUser>(IUserStore<TUser>)

Initializes a new instance of the UserManager<TUser> class.

Properties

Name Description
System_CAPS_pubproperty ClaimsIdentityFactory

Gets or sets the factory used to create claims identities from users.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty DefaultAccountLockoutTimeSpan

Gets or sets the default amount of time that a user is locked out for after MaxFailedAccessAttemptsBeforeLockout is reached.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty EmailService

Gets or sets the service used to send e-mail.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty MaxFailedAccessAttemptsBeforeLockout

Gets or sets the maximum number of access attempts allowed before a user is locked out (if lockout is enabled).(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty PasswordHasher

Gets or sets the property used to hash/verify passwords.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty PasswordValidator

Gets or sets the property used to validate passwords before persisting changes.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty SmsService

Gets or sets the property used to send a SMS message.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_protproperty Store

Gets or sets the persistence abstraction that the UserManager operates against.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty SupportsQueryableUsers

Gets a value that indicates whether the store is an IQueryableUserStore.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty SupportsUserClaim

Gets a value that indicates whether the store is an IUserClaimStore.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty SupportsUserEmail

Gets a value that indicates whether the store is an IUserEmailStore.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty SupportsUserLockout

Gets a value that indicates whether the store is an IUserLockoutStore.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty SupportsUserLogin

Gets a value that indicates whether the store is an IUserLoginStore.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty SupportsUserPassword

Gets a value that indicates whether the store is an IUserPasswordStore.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty SupportsUserPhoneNumber

Gets a value that indicates whether the store is an IUserPhoneNumberStore.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty SupportsUserRole

Gets a value that indicates whether the store is an IUserRoleStore.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty SupportsUserSecurityStamp

Gets a value that indicates whether the store is an IUserSecurityStore.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty SupportsUserTwoFactor

Gets a value that indicates whether the store is an IUserTwoFactorStore.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty TwoFactorProviders

Gets the registered two-factor authentication providers for users by their ID.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty UserLockoutEnabledByDefault

Gets or sets a value that indicates whether the user lockout is enabled when users are created. (Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty Users

Gets an IQueryable of users if the store is an IQueryableUserStore.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty UserTokenProvider

Gets or sets a property used for generating reset password and confirmation tokens.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubproperty UserValidator

Gets or sets a property used to validate users before changes are saved.(Inherited from UserManager<TUser, TKey>.)

Methods

Name Description
System_CAPS_pubmethod AccessFailedAsync(TKey)

Increments the access failed count for the user and if the failed access account is greater than or equal to the MaxFailedAccessAttempsBeforeLockout, the user will be locked out for the next DefaultAccountLockoutTimeSpan and the AccessFailedCount will be reset to 0. This is used for locking out the user account.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod AddClaimAsync(TKey, Claim)

Adds a user claim.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod AddLoginAsync(TKey, UserLoginInfo)

Associates a login with a user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod AddPasswordAsync(TKey, String)

Adds a user password only if one does not already exist.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod AddToRoleAsync(TKey, String)

Adds a user to a role.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod AddToRolesAsync(TKey, String[])

Method to add user to multiple roles(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod ChangePasswordAsync(TKey, String, String)

Changes a user password.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod ChangePhoneNumberAsync(TKey, String, String)

Sets a user phone number with the verification token.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod CheckPasswordAsync(TUser, String)

Determines whether the password is valid for the user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod ConfirmEmailAsync(TKey, String)

Confirms the user e-mail with confirmation token.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod CreateAsync(TUser)

Creates a user with no password.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod CreateAsync(TUser, String)

Creates a user with the given password.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod CreateIdentityAsync(TUser, String)

Creates a ClaimsIdentity representing the user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod DeleteAsync(TUser)

Deletes a user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod Dispose()

Releases the resources used by the current instance of the UserManager<TUser, TKey> class.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_protmethod Dispose(Boolean)

Releases the resources used by the current instance of the UserManager<TUser, TKey> class.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod FindAsync(String, String)

Returns a user with the specified username and password or null if there is no match.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod FindAsync(UserLoginInfo)

Returns the user associated with this login.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod FindByEmailAsync(String)

Finds a user by his e-mail.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod FindByIdAsync(TKey)

Finds a user by ID.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod FindByNameAsync(String)

Finds a user by user name.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GenerateChangePhoneNumberTokenAsync(TKey, String)

Generates a code that the user can use to change their phone number to a specific number.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GenerateEmailConfirmationTokenAsync(TKey)

Gets the e-mail confirmation token for the user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GeneratePasswordResetTokenAsync(TKey)

Generates a password reset token for the user using the UserTokenProvider.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GenerateTwoFactorTokenAsync(TKey, String)

Gets a token for a specific two factor provider.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GenerateUserTokenAsync(String, TKey)

Gets a user token for a specific purpose.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GetAccessFailedCountAsync(TKey)

Returns the number of failed access attempts for the user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GetClaimsAsync(TKey)

Gets a user claims.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GetEmailAsync(TKey)

Gets a user e-mail.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetLockoutEnabledAsync(TKey)

Determines whether the lockout is enabled for the user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GetLockoutEndDateAsync(TKey)

Returns when the user is no longer locked out, dates in the past are considered as not being locked out.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GetLoginsAsync(TKey)

Gets the logins for a user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GetPhoneNumberAsync(TKey)

Gets a user phone number.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GetRolesAsync(TKey)

Returns the roles for the user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GetSecurityStampAsync(TKey)

Returns the current security stamp for a user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GetTwoFactorEnabledAsync(TKey)

Determines whether two factor authentication is enabled for a user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod GetValidTwoFactorProvidersAsync(TKey)

Returns a list of valid two factor providers for a user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod HasPasswordAsync(TKey)

Determines whether the user has a password.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod IsEmailConfirmedAsync(TKey)

Determines whether the user e-mail has been confirmed. (Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod IsInRoleAsync(TKey, String)

Determines whether the user is in the specified role.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod IsLockedOutAsync(TKey)

Determines whether the user is locked out.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod IsPhoneNumberConfirmedAsync(TKey)

Determines whether the user phone number has been confirmed.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod NotifyTwoFactorTokenAsync(TKey, String, String)

Notifies a user with a token using a specific method of two-factor authentication provider.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod RegisterTwoFactorProvider(String, IUserTokenProvider<TUser, TKey>)

Registers a two factor authentication provider with the TwoFactorProviders mapping.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod RemoveClaimAsync(TKey, Claim)

Removes a user claim.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod RemoveFromRoleAsync(TKey, String)

Removes a user from a role.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod RemoveFromRolesAsync(TKey, String[])

Remove user from multiple roles(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod RemoveLoginAsync(TKey, UserLoginInfo)

Removes a user login.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod RemovePasswordAsync(TKey)

Removes a user password.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod ResetAccessFailedCountAsync(TKey)

Resets the access failed count for the user to 0.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod ResetPasswordAsync(TKey, String, String)

Resets a user password using a reset password token.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod SendEmailAsync(TKey, String, String)

Sends an e-mail to the user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod SendSmsAsync(TKey, String)

Sends the user a SMS message.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod SetEmailAsync(TKey, String)

Sets a user e-mail.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod SetLockoutEnabledAsync(TKey, Boolean)

Sets whether lockout is enabled for this user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod SetLockoutEndDateAsync(TKey, DateTimeOffset)

Sets the time when a user lockout ends.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod SetPhoneNumberAsync(TKey, String)

Sets a user phone number.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod SetTwoFactorEnabledAsync(TKey, Boolean)

Sets the two factor authentication enabled property for the user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_pubmethod UpdateAsync(TUser)

Updates a user.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_protmethod UpdatePassword(IUserPasswordStore<TUser, TKey>, TUser, String)

(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod UpdateSecurityStampAsync(TKey)

Generates a new security stamp for a user, used for SignOutEverywhere functionality.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod VerifyChangePhoneNumberTokenAsync(TKey, String, String)

Verifies whether the code is valid for a specific user and for a specific phone number.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_protmethod VerifyPasswordAsync(IUserPasswordStore<TUser, TKey>, TUser, String)

Retrieves the hashed password from the user store and calls PasswordHasher.VerifyHashPassword.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod VerifyTwoFactorTokenAsync(TKey, String, String)

Verifies a two factor token with the specified provider.(Inherited from UserManager<TUser, TKey>.)

System_CAPS_pubmethod VerifyUserTokenAsync(TKey, String, String)

Verifies a user token with the specified purpose.(Inherited from UserManager<TUser, TKey>.)

Thread Safety

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

See Also

Microsoft.AspNet.Identity Namespace
ASP.NET Identity

Return to top