// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading; using System.Threading.Tasks; namespace Microsoft.AspNet.Identity { /// /// Provides an abstraction for a store containing users' password hashes.. /// /// The type encapsulating a user. public interface IUserPasswordStore : IUserStore where TUser : class { /// /// Sets the password hash for the specified , as an asynchronous operation. /// /// The user whose password hash to set. /// The password hash to set. /// The used to propagate notifications that the operation should be canceled. /// The that represents the asynchronous operation. Task SetPasswordHashAsync(TUser user, string passwordHash, CancellationToken cancellationToken); /// /// Gets the password hash for the specified , as an asynchronous operation. /// /// The user whose password hash to retrieve. /// The used to propagate notifications that the operation should be canceled. /// The that represents the asynchronous operation, returning the password hash for the specified . Task GetPasswordHashAsync(TUser user, CancellationToken cancellationToken); /// /// Gets a flag indicating whether the specified has a password, as an asynchronous operation. /// /// The user to return a flag for, indicating whether they have a password or not. /// The used to propagate notifications that the operation should be canceled. /// /// The that represents the asynchronous operation, returning true if the specified has a password /// otherwise false. /// Task HasPasswordAsync(TUser user, CancellationToken cancellationToken); } }