// 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.AspNetCore.Identity { /// /// Provides an abstraction to store a user's authentication tokens. /// /// The type encapsulating a user. public interface IUserAuthenticationTokenStore : IUserStore where TUser : class { /// /// Sets the token value for a particular user. /// /// The user. /// The authentication provider for the token. /// The name of the token. /// The value of the token. /// The used to propagate notifications that the operation should be canceled. /// The that represents the asynchronous operation. Task SetTokenAsync(TUser user, string loginProvider, string name, string value, CancellationToken cancellationToken); /// /// Deletes a token for a user. /// /// The user. /// The authentication provider for the token. /// The name of the token. /// The used to propagate notifications that the operation should be canceled. /// The that represents the asynchronous operation. Task RemoveTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken); /// /// Returns the token value. /// /// The user. /// The authentication provider for the token. /// The name of the token. /// The used to propagate notifications that the operation should be canceled. /// The that represents the asynchronous operation. Task GetTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken); } }