UserManager<TUser, TKey> Class

 

Exposes user related APIs which will automatically save changes to the UserStore.

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

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

public class UserManager<TUser, TKey> : IDisposable
where TUser : class, IUser<TKey>
where TKey : object, IEquatable<TKey>

Type Parameters

TUser

The entity type of the user.

TKey

The entity key of the user.

NameDescription
System_CAPS_pubmethodUserManager<TUser, TKey>(IUserStore<TUser, TKey>)

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

NameDescription
System_CAPS_pubpropertyClaimsIdentityFactory

Gets or sets the factory used to create claims identities from users.

System_CAPS_pubpropertyDefaultAccountLockoutTimeSpan

Gets or sets the default amount of time that a user is locked out for after MaxFailedAccessAttemptsBeforeLockout is reached.

System_CAPS_pubpropertyEmailService

Gets or sets the service used to send e-mail.

System_CAPS_pubpropertyMaxFailedAccessAttemptsBeforeLockout

Gets or sets the maximum number of access attempts allowed before a user is locked out (if lockout is enabled).

System_CAPS_pubpropertyPasswordHasher

Gets or sets the property used to hash/verify passwords.

System_CAPS_pubpropertyPasswordValidator

Gets or sets the property used to validate passwords before persisting changes.

System_CAPS_pubpropertySmsService

Gets or sets the property used to send a SMS message.

System_CAPS_protpropertyStore

Gets or sets the persistence abstraction that the UserManager operates against.

System_CAPS_pubpropertySupportsQueryableUsers

Gets a value that indicates whether the store is an IQueryableUserStore.

System_CAPS_pubpropertySupportsUserClaim

Gets a value that indicates whether the store is an IUserClaimStore.

System_CAPS_pubpropertySupportsUserEmail

Gets a value that indicates whether the store is an IUserEmailStore.

System_CAPS_pubpropertySupportsUserLockout

Gets a value that indicates whether the store is an IUserLockoutStore.

System_CAPS_pubpropertySupportsUserLogin

Gets a value that indicates whether the store is an IUserLoginStore.

System_CAPS_pubpropertySupportsUserPassword

Gets a value that indicates whether the store is an IUserPasswordStore.

System_CAPS_pubpropertySupportsUserPhoneNumber

Gets a value that indicates whether the store is an IUserPhoneNumberStore.

System_CAPS_pubpropertySupportsUserRole

Gets a value that indicates whether the store is an IUserRoleStore.

System_CAPS_pubpropertySupportsUserSecurityStamp

Gets a value that indicates whether the store is an IUserSecurityStore.

System_CAPS_pubpropertySupportsUserTwoFactor

Gets a value that indicates whether the store is an IUserTwoFactorStore.

System_CAPS_pubpropertyTwoFactorProviders

Gets the registered two-factor authentication providers for users by their ID.

System_CAPS_pubpropertyUserLockoutEnabledByDefault

Gets or sets a value that indicates whether the user lockout is enabled when users are created.

System_CAPS_pubpropertyUsers

Gets an IQueryable of users if the store is an IQueryableUserStore.

System_CAPS_pubpropertyUserTokenProvider

Gets or sets a property used for generating reset password and confirmation tokens.

System_CAPS_pubpropertyUserValidator

Gets or sets a property used to validate users before changes are saved.

NameDescription
System_CAPS_pubmethodAccessFailedAsync(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.

System_CAPS_pubmethodAddClaimAsync(TKey, Claim)

Adds a user claim.

System_CAPS_pubmethodAddLoginAsync(TKey, UserLoginInfo)

Associates a login with a user.

System_CAPS_pubmethodAddPasswordAsync(TKey, String)

Adds a user password only if one does not already exist.

System_CAPS_pubmethodAddToRoleAsync(TKey, String)

Adds a user to a role.

System_CAPS_pubmethodAddToRolesAsync(TKey, String[])

Method to add user to multiple roles

System_CAPS_pubmethodChangePasswordAsync(TKey, String, String)

Changes a user password.

System_CAPS_pubmethodChangePhoneNumberAsync(TKey, String, String)

Sets a user phone number with the verification token.

System_CAPS_pubmethodCheckPasswordAsync(TUser, String)

Determines whether the password is valid for the user.

System_CAPS_pubmethodConfirmEmailAsync(TKey, String)

Confirms the user e-mail with confirmation token.

System_CAPS_pubmethodCreateAsync(TUser)

Creates a user with no password.

System_CAPS_pubmethodCreateAsync(TUser, String)

Creates a user with the given password.

System_CAPS_pubmethodCreateIdentityAsync(TUser, String)

Creates a ClaimsIdentity representing the user.

System_CAPS_pubmethodDeleteAsync(TUser)

Deletes a user.

System_CAPS_pubmethodDispose()

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

System_CAPS_protmethodDispose(Boolean)

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

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodFindAsync(String, String)

Returns a user with the specified username and password or null if there is no match.

System_CAPS_pubmethodFindAsync(UserLoginInfo)

Returns the user associated with this login.

System_CAPS_pubmethodFindByEmailAsync(String)

Finds a user by his e-mail.

System_CAPS_pubmethodFindByIdAsync(TKey)

Finds a user by ID.

System_CAPS_pubmethodFindByNameAsync(String)

Finds a user by user name.

System_CAPS_pubmethodGenerateChangePhoneNumberTokenAsync(TKey, String)

Generates a code that the user can use to change their phone number to a specific number.

System_CAPS_pubmethodGenerateEmailConfirmationTokenAsync(TKey)

Gets the e-mail confirmation token for the user.

System_CAPS_pubmethodGeneratePasswordResetTokenAsync(TKey)

Generates a password reset token for the user using the UserTokenProvider.

System_CAPS_pubmethodGenerateTwoFactorTokenAsync(TKey, String)

Gets a token for a specific two factor provider.

System_CAPS_pubmethodGenerateUserTokenAsync(String, TKey)

Gets a user token for a specific purpose.

System_CAPS_pubmethodGetAccessFailedCountAsync(TKey)

Returns the number of failed access attempts for the user.

System_CAPS_pubmethodGetClaimsAsync(TKey)

Gets a user claims.

System_CAPS_pubmethodGetEmailAsync(TKey)

Gets a user e-mail.

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetLockoutEnabledAsync(TKey)

Determines whether the lockout is enabled for the user.

System_CAPS_pubmethodGetLockoutEndDateAsync(TKey)

Returns when the user is no longer locked out, dates in the past are considered as not being locked out.

System_CAPS_pubmethodGetLoginsAsync(TKey)

Gets the logins for a user.

System_CAPS_pubmethodGetPhoneNumberAsync(TKey)

Gets a user phone number.

System_CAPS_pubmethodGetRolesAsync(TKey)

Returns the roles for the user.

System_CAPS_pubmethodGetSecurityStampAsync(TKey)

Returns the current security stamp for a user.

System_CAPS_pubmethodGetTwoFactorEnabledAsync(TKey)

Determines whether two factor authentication is enabled for a user.

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodGetValidTwoFactorProvidersAsync(TKey)

Returns a list of valid two factor providers for a user.

System_CAPS_pubmethodHasPasswordAsync(TKey)

Determines whether the user has a password.

System_CAPS_pubmethodIsEmailConfirmedAsync(TKey)

Determines whether the user e-mail has been confirmed.

System_CAPS_pubmethodIsInRoleAsync(TKey, String)

Determines whether the user is in the specified role.

System_CAPS_pubmethodIsLockedOutAsync(TKey)

Determines whether the user is locked out.

System_CAPS_pubmethodIsPhoneNumberConfirmedAsync(TKey)

Determines whether the user phone number has been confirmed.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodNotifyTwoFactorTokenAsync(TKey, String, String)

Notifies a user with a token using a specific method of two-factor authentication provider.

System_CAPS_pubmethodRegisterTwoFactorProvider(String, IUserTokenProvider<TUser, TKey>)

Registers a two factor authentication provider with the TwoFactorProviders mapping.

System_CAPS_pubmethodRemoveClaimAsync(TKey, Claim)

Removes a user claim.

System_CAPS_pubmethodRemoveFromRoleAsync(TKey, String)

Removes a user from a role.

System_CAPS_pubmethodRemoveFromRolesAsync(TKey, String[])

Remove user from multiple roles

System_CAPS_pubmethodRemoveLoginAsync(TKey, UserLoginInfo)

Removes a user login.

System_CAPS_pubmethodRemovePasswordAsync(TKey)

Removes a user password.

System_CAPS_pubmethodResetAccessFailedCountAsync(TKey)

Resets the access failed count for the user to 0.

System_CAPS_pubmethodResetPasswordAsync(TKey, String, String)

Resets a user password using a reset password token.

System_CAPS_pubmethodSendEmailAsync(TKey, String, String)

Sends an e-mail to the user.

System_CAPS_pubmethodSendSmsAsync(TKey, String)

Sends the user a SMS message.

System_CAPS_pubmethodSetEmailAsync(TKey, String)

Sets a user e-mail.

System_CAPS_pubmethodSetLockoutEnabledAsync(TKey, Boolean)

Sets whether lockout is enabled for this user.

System_CAPS_pubmethodSetLockoutEndDateAsync(TKey, DateTimeOffset)

Sets the time when a user lockout ends.

System_CAPS_pubmethodSetPhoneNumberAsync(TKey, String)

Sets a user phone number.

System_CAPS_pubmethodSetTwoFactorEnabledAsync(TKey, Boolean)

Sets the two factor authentication enabled property for the user.

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_pubmethodUpdateAsync(TUser)

Updates a user.

System_CAPS_protmethodUpdatePassword(IUserPasswordStore<TUser, TKey>, TUser, String)

System_CAPS_pubmethodUpdateSecurityStampAsync(TKey)

Generates a new security stamp for a user, used for SignOutEverywhere functionality.

System_CAPS_pubmethodVerifyChangePhoneNumberTokenAsync(TKey, String, String)

Verifies whether the code is valid for a specific user and for a specific phone number.

System_CAPS_protmethodVerifyPasswordAsync(IUserPasswordStore<TUser, TKey>, TUser, String)

Retrieves the hashed password from the user store and calls PasswordHasher.VerifyHashPassword.

System_CAPS_pubmethodVerifyTwoFactorTokenAsync(TKey, String, String)

Verifies a two factor token with the specified provider.

System_CAPS_pubmethodVerifyUserTokenAsync(TKey, String, String)

Verifies a user token with the specified purpose.

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

Return to top
Show: