using System.Threading.Tasks; using Wino.Core.Domain.Entities; using Wino.Core.Domain.Enums; namespace Wino.Core.Domain.Interfaces { public interface IAuthenticator { /// /// Type of the provider. /// MailProviderType ProviderType { get; } /// /// Gets the token from the cache if exists. /// If the token is expired, tries to refresh. /// This can throw AuthenticationAttentionException if silent refresh fails. /// /// Account to get token for. /// Valid token info to be used in integrators. Task GetTokenAsync(MailAccount account); /// /// Initial creation of token. Requires user interaction. /// This will cache the token but still returns for account creation /// since account address is required. /// /// Freshly created TokenInformation.. Task GenerateTokenAsync(MailAccount account, bool saveToken); /// /// ClientId in case of needed for authorization/authentication. /// string ClientId { get; } } }