Show / Hide Table of Contents

Class IdentityUserStore

Represents a new instance of a persistence store for the specified user and role types.

Inheritance
System.Object
IdentityUserStore
Implements
IUserRoleStore<IdentityUser>
IUserClaimStore<IdentityUser>
IUserPasswordStore<IdentityUser>
IUserSecurityStampStore<IdentityUser>
IUserEmailStore<IdentityUser>
IUserLockoutStore<IdentityUser>
IUserPhoneNumberStore<IdentityUser>
IUserTwoFactorStore<IdentityUser>
IUserAuthenticationTokenStore<IdentityUser>
IUserAuthenticatorKeyStore<IdentityUser>
IUserTwoFactorRecoveryCodeStore<IdentityUser>
ITransientDependency
Namespace: Volo.Abp.Identity
Assembly: Volo.Abp.Identity.Domain.dll
Syntax
public class IdentityUserStore : IUserLoginStore<IdentityUser>, IUserRoleStore<IdentityUser>, IUserClaimStore<IdentityUser>, IUserPasswordStore<IdentityUser>, IUserSecurityStampStore<IdentityUser>, IUserEmailStore<IdentityUser>, IUserLockoutStore<IdentityUser>, IUserPhoneNumberStore<IdentityUser>, IUserTwoFactorStore<IdentityUser>, IUserAuthenticationTokenStore<IdentityUser>, IUserAuthenticatorKeyStore<IdentityUser>, IUserTwoFactorRecoveryCodeStore<IdentityUser>, ITransientDependency

Constructors

IdentityUserStore(IIdentityUserRepository, IIdentityRoleRepository, IGuidGenerator, ILogger<IdentityRoleStore>, ILookupNormalizer, IdentityErrorDescriber)

Declaration
public IdentityUserStore(IIdentityUserRepository userRepository, IIdentityRoleRepository roleRepository, IGuidGenerator guidGenerator, ILogger<IdentityRoleStore> logger, ILookupNormalizer lookupNormalizer, IdentityErrorDescriber describer = null)
Parameters
Type Name Description
IIdentityUserRepository userRepository
IIdentityRoleRepository roleRepository
IGuidGenerator guidGenerator
ILogger<IdentityRoleStore> logger
ILookupNormalizer lookupNormalizer
IdentityErrorDescriber describer

Properties

AutoSaveChanges

Gets or sets a flag indicating if changes should be persisted after CreateAsync, UpdateAsync and DeleteAsync are called.

Declaration
public bool AutoSaveChanges { get; set; }
Property Value
Type Description
System.Boolean

True if changes should be automatically persisted, otherwise false.

ErrorDescriber

Gets or sets the for any error that occurred with the current operation.

Declaration
public IdentityErrorDescriber ErrorDescriber { get; set; }
Property Value
Type Description
IdentityErrorDescriber

GuidGenerator

Declaration
protected IGuidGenerator GuidGenerator { get; }
Property Value
Type Description
IGuidGenerator

Logger

Declaration
protected ILogger<IdentityRoleStore> Logger { get; }
Property Value
Type Description
ILogger<IdentityRoleStore>

LookupNormalizer

Declaration
protected ILookupNormalizer LookupNormalizer { get; }
Property Value
Type Description
ILookupNormalizer

RoleRepository

Declaration
protected IIdentityRoleRepository RoleRepository { get; }
Property Value
Type Description
IIdentityRoleRepository

UserRepository

Declaration
protected IIdentityUserRepository UserRepository { get; }
Property Value
Type Description
IIdentityUserRepository

Methods

AddClaimsAsync(IdentityUser, IEnumerable<Claim>, CancellationToken)

Adds the claims given to the specified user.

Declaration
public virtual Task AddClaimsAsync(IdentityUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to add the claim to.

IEnumerable<Claim> claims

The claim to add to the user.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

AddLoginAsync(IdentityUser, UserLoginInfo, CancellationToken)

Adds the login given to the specified user.

Declaration
public virtual Task AddLoginAsync(IdentityUser user, UserLoginInfo login, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to add the login to.

UserLoginInfo login

The login to add to the user.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

AddToRoleAsync(IdentityUser, String, CancellationToken)

Adds the given normalizedRoleName to the specified user.

Declaration
public virtual Task AddToRoleAsync(IdentityUser user, string normalizedRoleName, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to add the role to.

System.String normalizedRoleName

The role to add.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

CountCodesAsync(IdentityUser, CancellationToken)

Returns how many recovery code are still valid for a user.

Declaration
public virtual Task<int> CountCodesAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user who owns the recovery code.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.Int32>

The number of valid recovery codes for the user..

CreateAsync(IdentityUser, CancellationToken)

Creates the specified user in the user store.

Declaration
public virtual Task<IdentityResult> CreateAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to create.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<IdentityResult>

The that represents the asynchronous operation, containing the of the creation operation.

DeleteAsync(IdentityUser, CancellationToken)

Deletes the specified user from the user store.

Declaration
public virtual Task<IdentityResult> DeleteAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to delete.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<IdentityResult>

The that represents the asynchronous operation, containing the of the update operation.

Dispose()

Declaration
public virtual void Dispose()

FindByEmailAsync(String, CancellationToken)

Gets the user, if any, associated with the specified, normalized email address.

Declaration
public virtual Task<IdentityUser> FindByEmailAsync(string normalizedEmail, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String normalizedEmail

The normalized email address to return the user for.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<IdentityUser>

The task object containing the results of the asynchronous lookup operation, the user if any associated with the specified normalized email address.

FindByIdAsync(String, CancellationToken)

Finds and returns a user, if any, who has the specified userId.

Declaration
public virtual Task<IdentityUser> FindByIdAsync(string userId, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String userId

The user ID to search for.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<IdentityUser>

The that represents the asynchronous operation, containing the user matching the specified userId if it exists.

FindByLoginAsync(String, String, CancellationToken)

Retrieves the user associated with the specified login provider and login provider key..

Declaration
public virtual Task<IdentityUser> FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String loginProvider

The login provider who provided the providerKey.

System.String providerKey

The key provided by the loginProvider to identify a user.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<IdentityUser>

The for the asynchronous operation, containing the user, if any which matched the specified login provider and key.

FindByNameAsync(String, CancellationToken)

Finds and returns a user, if any, who has the specified normalized user name.

Declaration
public virtual Task<IdentityUser> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String normalizedUserName

The normalized user name to search for.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<IdentityUser>

The that represents the asynchronous operation, containing the user matching the specified normalizedUserName if it exists.

GetAccessFailedCountAsync(IdentityUser, CancellationToken)

Retrieves the current failed access count for the specified user..

Declaration
public virtual Task<int> GetAccessFailedCountAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose failed access count should be retrieved.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.Int32>

The that represents the asynchronous operation, containing the failed access count.

GetAuthenticatorKeyAsync(IdentityUser, CancellationToken)

Declaration
public virtual Task<string> GetAuthenticatorKeyAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user
CancellationToken cancellationToken
Returns
Type Description
Task<System.String>

GetClaimsAsync(IdentityUser, CancellationToken)

Get the claims associated with the specified user as an asynchronous operation.

Declaration
public virtual Task<IList<Claim>> GetClaimsAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose claims should be retrieved.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<IList<Claim>>

A that contains the claims granted to a user.

GetEmailAsync(IdentityUser, CancellationToken)

Gets the email address for the specified user.

Declaration
public virtual Task<string> GetEmailAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose email should be returned.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.String>

The task object containing the results of the asynchronous operation, the email address for the specified user.

GetEmailConfirmedAsync(IdentityUser, CancellationToken)

Gets a flag indicating whether the email address for the specified user has been verified, true if the email address is verified otherwise false.

Declaration
public virtual Task<bool> GetEmailConfirmedAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose email confirmation status should be returned.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.Boolean>

The task object containing the results of the asynchronous operation, a flag indicating whether the email address for the specified user has been confirmed or not.

GetLockoutEnabledAsync(IdentityUser, CancellationToken)

Retrieves a flag indicating whether user lockout can enabled for the specified user.

Declaration
public virtual Task<bool> GetLockoutEnabledAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose ability to be locked out should be returned.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.Boolean>

The that represents the asynchronous operation, true if a user can be locked out, otherwise false.

GetLockoutEndDateAsync(IdentityUser, CancellationToken)

Gets the last a user's last lockout expired, if any. Any time in the past should be indicates a user is not locked out.

Declaration
public virtual Task<DateTimeOffset?> GetLockoutEndDateAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose lockout date should be retrieved.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.Nullable<DateTimeOffset>>

A that represents the result of the asynchronous query, a containing the last time a user's lockout expired, if any.

GetLoginsAsync(IdentityUser, CancellationToken)

Retrieves the associated logins for the specified .

Declaration
public virtual Task<IList<UserLoginInfo>> GetLoginsAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose associated logins to retrieve.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<IList<UserLoginInfo>>

The for the asynchronous operation, containing a list of for the specified user, if any.

GetNormalizedEmailAsync(IdentityUser, CancellationToken)

Returns the normalized email for the specified user.

Declaration
public virtual Task<string> GetNormalizedEmailAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose email address to retrieve.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.String>

The task object containing the results of the asynchronous lookup operation, the normalized email address if any associated with the specified user.

GetNormalizedUserNameAsync(IdentityUser, CancellationToken)

Gets the normalized user name for the specified user.

Declaration
public virtual Task<string> GetNormalizedUserNameAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose normalized name should be retrieved.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.String>

The that represents the asynchronous operation, containing the normalized user name for the specified user.

GetPasswordHashAsync(IdentityUser, CancellationToken)

Gets the password hash for a user.

Declaration
public virtual Task<string> GetPasswordHashAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to retrieve the password hash for.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.String>

A that contains the password hash for the user.

GetPhoneNumberAsync(IdentityUser, CancellationToken)

Gets the telephone number, if any, for the specified user.

Declaration
public virtual Task<string> GetPhoneNumberAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose telephone number should be retrieved.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.String>

The that represents the asynchronous operation, containing the user's telephone number, if any.

GetPhoneNumberConfirmedAsync(IdentityUser, CancellationToken)

Gets a flag indicating whether the specified user's telephone number has been confirmed.

Declaration
public virtual Task<bool> GetPhoneNumberConfirmedAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to return a flag for, indicating whether their telephone number is confirmed.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.Boolean>

The that represents the asynchronous operation, returning true if the specified user has a confirmed telephone number otherwise false.

GetRolesAsync(IdentityUser, CancellationToken)

Retrieves the roles the specified user is a member of.

Declaration
public virtual Task<IList<string>> GetRolesAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose roles should be retrieved.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<IList<System.String>>

A that contains the roles the user is a member of.

GetSecurityStampAsync(IdentityUser, CancellationToken)

Get the security stamp for the specified user.

Declaration
public virtual Task<string> GetSecurityStampAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose security stamp should be set.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.String>

The that represents the asynchronous operation, containing the security stamp for the specified user.

GetTokenAsync(IdentityUser, String, String, CancellationToken)

Returns the token value.

Declaration
public virtual Task<string> GetTokenAsync(IdentityUser user, string loginProvider, string name, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user.

System.String loginProvider

The authentication provider for the token.

System.String name

The name of the token.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.String>

The that represents the asynchronous operation.

GetTwoFactorEnabledAsync(IdentityUser, CancellationToken)

Returns a flag indicating whether the specified user has two factor authentication enabled or not, as an asynchronous operation.

Declaration
public virtual Task<bool> GetTwoFactorEnabledAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose two factor authentication enabled status should be set.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.Boolean>

The that represents the asynchronous operation, containing a flag indicating whether the specified user has two factor authentication enabled or not.

GetUserIdAsync(IdentityUser, CancellationToken)

Gets the user identifier for the specified user.

Declaration
public virtual Task<string> GetUserIdAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose identifier should be retrieved.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.String>

The that represents the asynchronous operation, containing the identifier for the specified user.

GetUserNameAsync(IdentityUser, CancellationToken)

Gets the user name for the specified user.

Declaration
public virtual Task<string> GetUserNameAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose name should be retrieved.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.String>

The that represents the asynchronous operation, containing the name for the specified user.

GetUsersForClaimAsync(Claim, CancellationToken)

Retrieves all users with the specified claim.

Declaration
public virtual Task<IList<IdentityUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = null)
Parameters
Type Name Description
Claim claim

The claim whose users should be retrieved.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<IList<IdentityUser>>

The contains a list of users, if any, that contain the specified claim.

GetUsersInRoleAsync(String, CancellationToken)

Retrieves all users in the specified role.

Declaration
public virtual Task<IList<IdentityUser>> GetUsersInRoleAsync(string normalizedRoleName, CancellationToken cancellationToken = null)
Parameters
Type Name Description
System.String normalizedRoleName

The role whose users should be retrieved.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<IList<IdentityUser>>

The contains a list of users, if any, that are in the specified role.

HasPasswordAsync(IdentityUser, CancellationToken)

Returns a flag indicating if the specified user has a password.

Declaration
public virtual Task<bool> HasPasswordAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to retrieve the password hash for.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.Boolean>

A containing a flag indicating if the specified user has a password. If the user has a password the returned value with be true, otherwise it will be false.

IncrementAccessFailedCountAsync(IdentityUser, CancellationToken)

Records that a failed access has occurred, incrementing the failed access count.

Declaration
public virtual Task<int> IncrementAccessFailedCountAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose cancellation count should be incremented.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.Int32>

The that represents the asynchronous operation, containing the incremented failed access count.

IsInRoleAsync(IdentityUser, String, CancellationToken)

Returns a flag indicating if the specified user is a member of the give normalizedRoleName.

Declaration
public virtual Task<bool> IsInRoleAsync(IdentityUser user, string normalizedRoleName, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose role membership should be checked.

System.String normalizedRoleName

The role to check membership of

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.Boolean>

A containing a flag indicating if the specified user is a member of the given group. If the user is a member of the group the returned value with be true, otherwise it will be false.

RedeemCodeAsync(IdentityUser, String, CancellationToken)

Returns whether a recovery code is valid for a user. Note: recovery codes are only valid once, and will be invalid after use.

Declaration
public virtual Task<bool> RedeemCodeAsync(IdentityUser user, string code, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user who owns the recovery code.

System.String code

The recovery code to use.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<System.Boolean>

True if the recovery code was found for the user.

RemoveClaimsAsync(IdentityUser, IEnumerable<Claim>, CancellationToken)

Removes the claims given from the specified user.

Declaration
public virtual Task RemoveClaimsAsync(IdentityUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to remove the claims from.

IEnumerable<Claim> claims

The claim to remove.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

RemoveFromRoleAsync(IdentityUser, String, CancellationToken)

Removes the given normalizedRoleName from the specified user.

Declaration
public virtual Task RemoveFromRoleAsync(IdentityUser user, string normalizedRoleName, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to remove the role from.

System.String normalizedRoleName

The role to remove.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

RemoveLoginAsync(IdentityUser, String, String, CancellationToken)

Removes the loginProvider given from the specified user.

Declaration
public virtual Task RemoveLoginAsync(IdentityUser user, string loginProvider, string providerKey, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to remove the login from.

System.String loginProvider

The login to remove from the user.

System.String providerKey

The key provided by the loginProvider to identify a user.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

RemoveTokenAsync(IdentityUser, String, String, CancellationToken)

Deletes a token for a user.

Declaration
public virtual Task RemoveTokenAsync(IdentityUser user, string loginProvider, string name, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user.

System.String loginProvider

The authentication provider for the token.

System.String name

The name of the token.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

ReplaceClaimAsync(IdentityUser, Claim, Claim, CancellationToken)

Replaces the claim on the specified user, with the newClaim.

Declaration
public virtual Task ReplaceClaimAsync(IdentityUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to replace the claim on.

Claim claim

The claim replace.

Claim newClaim

The new claim replacing the claim.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

ReplaceCodesAsync(IdentityUser, IEnumerable<String>, CancellationToken)

Updates the recovery codes for the user while invalidating any previous recovery codes.

Declaration
public virtual Task ReplaceCodesAsync(IdentityUser user, IEnumerable<string> recoveryCodes, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to store new recovery codes for.

IEnumerable<System.String> recoveryCodes

The new recovery codes for the user.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The new recovery codes for the user.

ResetAccessFailedCountAsync(IdentityUser, CancellationToken)

Resets a user's failed access count.

Declaration
public virtual Task ResetAccessFailedCountAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose failed access count should be reset.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

Remarks

This is typically called after the account is successfully accessed.

SetAuthenticatorKeyAsync(IdentityUser, String, CancellationToken)

Declaration
public virtual Task SetAuthenticatorKeyAsync(IdentityUser user, string key, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user
System.String key
CancellationToken cancellationToken
Returns
Type Description
Task

SetEmailAsync(IdentityUser, String, CancellationToken)

Sets the email address for a user.

Declaration
public virtual Task SetEmailAsync(IdentityUser user, string email, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose email should be set.

System.String email

The email to set.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The task object representing the asynchronous operation.

SetEmailConfirmedAsync(IdentityUser, Boolean, CancellationToken)

Sets the flag indicating whether the specified user's email address has been confirmed or not.

Declaration
public virtual Task SetEmailConfirmedAsync(IdentityUser user, bool confirmed, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose email confirmation status should be set.

System.Boolean confirmed

A flag indicating if the email address has been confirmed, true if the address is confirmed otherwise false.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The task object representing the asynchronous operation.

SetLockoutEnabledAsync(IdentityUser, Boolean, CancellationToken)

Set the flag indicating if the specified user can be locked out..

Declaration
public virtual Task SetLockoutEnabledAsync(IdentityUser user, bool enabled, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose ability to be locked out should be set.

System.Boolean enabled

A flag indicating if lock out can be enabled for the specified user.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

SetLockoutEndDateAsync(IdentityUser, Nullable<DateTimeOffset>, CancellationToken)

Locks out a user until the specified end date has passed. Setting a end date in the past immediately unlocks a user.

Declaration
public virtual Task SetLockoutEndDateAsync(IdentityUser user, DateTimeOffset? lockoutEnd, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose lockout date should be set.

System.Nullable<DateTimeOffset> lockoutEnd

The after which the user's lockout should end.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

SetNormalizedEmailAsync(IdentityUser, String, CancellationToken)

Sets the normalized email for the specified user.

Declaration
public virtual Task SetNormalizedEmailAsync(IdentityUser user, string normalizedEmail, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose email address to set.

System.String normalizedEmail

The normalized email to set for the specified user.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The task object representing the asynchronous operation.

SetNormalizedUserNameAsync(IdentityUser, String, CancellationToken)

Sets the given normalized name for the specified user.

Declaration
public virtual Task SetNormalizedUserNameAsync(IdentityUser user, string normalizedName, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose name should be set.

System.String normalizedName

The normalized name to set.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

SetPasswordHashAsync(IdentityUser, String, CancellationToken)

Sets the password hash for a user.

Declaration
public virtual Task SetPasswordHashAsync(IdentityUser user, string passwordHash, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to set the password hash for.

System.String passwordHash

The password hash to set.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

SetPhoneNumberAsync(IdentityUser, String, CancellationToken)

Sets the telephone number for the specified user.

Declaration
public virtual Task SetPhoneNumberAsync(IdentityUser user, string phoneNumber, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose telephone number should be set.

System.String phoneNumber

The telephone number to set.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

SetPhoneNumberConfirmedAsync(IdentityUser, Boolean, CancellationToken)

Sets a flag indicating if the specified user's phone number has been confirmed..

Declaration
public virtual Task SetPhoneNumberConfirmedAsync(IdentityUser user, bool confirmed, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose telephone number confirmation status should be set.

System.Boolean confirmed

A flag indicating whether the user's telephone number has been confirmed.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

SetSecurityStampAsync(IdentityUser, String, CancellationToken)

Sets the provided security stamp for the specified user.

Declaration
public virtual Task SetSecurityStampAsync(IdentityUser user, string stamp, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose security stamp should be set.

System.String stamp

The security stamp to set.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

SetTokenAsync(IdentityUser, String, String, String, CancellationToken)

Sets the token value for a particular user.

Declaration
public virtual Task SetTokenAsync(IdentityUser user, string loginProvider, string name, string value, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user.

System.String loginProvider

The authentication provider for the token.

System.String name

The name of the token.

System.String value

The value of the token.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

SetTwoFactorEnabledAsync(IdentityUser, Boolean, CancellationToken)

Sets a flag indicating whether the specified user has two factor authentication enabled or not, as an asynchronous operation.

Declaration
public virtual Task SetTwoFactorEnabledAsync(IdentityUser user, bool enabled, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose two factor authentication enabled status should be set.

System.Boolean enabled

A flag indicating whether the specified user has two factor authentication enabled.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

SetUserNameAsync(IdentityUser, String, CancellationToken)

Sets the given userName for the specified user.

Declaration
public virtual Task SetUserNameAsync(IdentityUser user, string userName, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user whose name should be set.

System.String userName

The user name to set.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task

The that represents the asynchronous operation.

UpdateAsync(IdentityUser, CancellationToken)

Updates the specified user in the user store.

Declaration
public virtual Task<IdentityResult> UpdateAsync(IdentityUser user, CancellationToken cancellationToken = null)
Parameters
Type Name Description
IdentityUser user

The user to update.

CancellationToken cancellationToken

The used to propagate notifications that the operation should be canceled.

Returns
Type Description
Task<IdentityResult>

The that represents the asynchronous operation, containing the of the update operation.

Implements

IUserRoleStore<>
IUserClaimStore<>
IUserPasswordStore<>
IUserSecurityStampStore<>
IUserEmailStore<>
IUserLockoutStore<>
IUserPhoneNumberStore<>
IUserTwoFactorStore<>
IUserAuthenticationTokenStore<>
IUserAuthenticatorKeyStore<>
IUserTwoFactorRecoveryCodeStore<>
ITransientDependency

Extension Methods

AbpObjectExtensions.As<T>(Object)
AbpObjectExtensions.To<T>(Object)
AbpObjectExtensions.IsIn<T>(T, T[])
AbpObjectExtensions.If<T>(T, Boolean, Func<T, T>)
AbpObjectExtensions.If<T>(T, Boolean, Action<T>)
LockExtensions.Locking(Object, Action)
LockExtensions.Locking<T>(T, Action<T>)
LockExtensions.Locking<TResult>(Object, Func<TResult>)
LockExtensions.Locking<T, TResult>(T, Func<T, TResult>)
Back to top Powered by Volosoft