IUserPasswordStore<TUser> Interface

Summary

Provides an abstraction for a store containing users’ password hashes..

Syntax

public interface IUserPasswordStore<TUser> : IUserStore<TUser>, IDisposable where TUser : class

GitHub

View on GitHub

interface Microsoft.AspNet.Identity.IUserPasswordStore<TUser>

Methods

GetPasswordHashAsync(TUser, System.Threading.CancellationToken)

Gets the password hash for the specified user, as an asynchronous operation.

Arguments:
  • user ({TUser}) – The user whose password hash to retrieve.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task{System.String}

Returns:

The <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation, returning the password hash for the specified <paramref name=”user” />.

Task<string> GetPasswordHashAsync(TUser user, CancellationToken cancellationToken)
HasPasswordAsync(TUser, System.Threading.CancellationToken)

Gets a flag indicating whether the specified user has a password, as an asynchronous operation.

Arguments:
  • user ({TUser}) – The user to return a flag for, indicating whether they have a password or not.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task{System.Boolean}

Returns:

The <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation, returning true if the specified <paramref name=”user” /> has a password otherwise false.

Task<bool> HasPasswordAsync(TUser user, CancellationToken cancellationToken)
SetPasswordHashAsync(TUser, System.String, System.Threading.CancellationToken)

Sets the password hash for the specified user, as an asynchronous operation.

Arguments:
  • user ({TUser}) – The user whose password hash to set.
  • passwordHash (System.String) – The password hash to set.
  • cancellationToken (System.Threading.CancellationToken) – The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.
Return type:

System.Threading.Tasks.Task

Returns:

The <see cref=”T:System.Threading.Tasks.Task” /> that represents the asynchronous operation.

Task SetPasswordHashAsync(TUser user, string passwordHash, CancellationToken cancellationToken)