Class IdentityUserStore
Represents a new instance of a persistence store for the specified user and role types.
Inheritance
Implements
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
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
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 |
Returns
Type | Description |
---|---|
Task<IdentityResult> | The |
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 |
Returns
Type | Description |
---|---|
Task<IdentityResult> | The |
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 |
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 |
Returns
Type | Description |
---|---|
Task<IdentityUser> | The |
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 |
System.String | providerKey | The key provided by the |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
Task<IdentityUser> | The |
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 |
Returns
Type | Description |
---|---|
Task<IdentityUser> | The |
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 |
Returns
Type | Description |
---|---|
Task<System.Int32> | The |
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 |
Returns
Type | Description |
---|---|
Task<IList<Claim>> | A |
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 |
Returns
Type | Description |
---|---|
Task<System.String> | The task object containing the results of the asynchronous operation, the email address for the specified |
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 |
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 |
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 |
Returns
Type | Description |
---|---|
Task<System.Boolean> | The |
GetLockoutEndDateAsync(IdentityUser, CancellationToken)
Gets the last
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 |
Returns
Type | Description |
---|---|
Task<System.Nullable<DateTimeOffset>> | A |
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 |
Returns
Type | Description |
---|---|
Task<IList<UserLoginInfo>> | The |
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 |
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 |
Returns
Type | Description |
---|---|
Task<System.String> | The |
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 |
Returns
Type | Description |
---|---|
Task<System.String> | A |
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 |
Returns
Type | Description |
---|---|
Task<System.String> | The |
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 |
Returns
Type | Description |
---|---|
Task<System.Boolean> | The |
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 |
Returns
Type | Description |
---|---|
Task<IList<System.String>> | A |
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 |
Returns
Type | Description |
---|---|
Task<System.String> | The |
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 |
Returns
Type | Description |
---|---|
Task<System.String> | The |
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 |
Returns
Type | Description |
---|---|
Task<System.Boolean> | The |
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 |
Returns
Type | Description |
---|---|
Task<System.String> | The |
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 |
Returns
Type | Description |
---|---|
Task<System.String> | The |
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 |
Returns
Type | Description |
---|---|
Task<IList<IdentityUser>> | The |
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 |
Returns
Type | Description |
---|---|
Task<IList<IdentityUser>> | The |
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 |
Returns
Type | Description |
---|---|
Task<System.Boolean> | A |
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 |
Returns
Type | Description |
---|---|
Task<System.Int32> | The |
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 |
Returns
Type | Description |
---|---|
Task<System.Boolean> | A |
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 |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
Task | The |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
Task | The |
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 |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 | The email to set. |
|
CancellationToken | cancellationToken | The |
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 |
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 |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
Task | The |
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 |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
Task | The |
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 |
CancellationToken | cancellationToken | The |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
Task | The |
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 |
Returns
Type | Description |
---|---|
Task | The |
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 |
Returns
Type | Description |
---|---|
Task<IdentityResult> | The |