2024-08-05 00:36:26 +02:00
|
|
|
|
using System.Threading.Tasks;
|
2024-11-10 23:28:25 +01:00
|
|
|
|
using Wino.Core.Domain.Entities.Shared;
|
2024-04-18 01:44:37 +02:00
|
|
|
|
using Wino.Core.Domain.Enums;
|
2024-11-20 01:45:48 +01:00
|
|
|
|
using Wino.Core.Domain.Models.Authentication;
|
2024-04-18 01:44:37 +02:00
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
namespace Wino.Core.Domain.Interfaces;
|
|
|
|
|
|
|
|
|
|
|
|
public interface IAuthenticator
|
2024-04-18 01:44:37 +02:00
|
|
|
|
{
|
2025-02-16 11:54:23 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Type of the provider.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
MailProviderType ProviderType { get; }
|
2024-04-18 01:44:37 +02:00
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
Task<TokenInformationEx> GetTokenInformationAsync(MailAccount account);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
Task<TokenInformationEx> GenerateTokenInformationAsync(MailAccount account);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// Gets the token for the given account from the cache.
|
|
|
|
|
|
///// Forces interactive login if the token is not found.
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
///// <param name="account">Account to get access token for.</param>
|
|
|
|
|
|
///// <returns>Access token</returns>
|
|
|
|
|
|
//Task<string> GetTokenAsync(MailAccount account);
|
2024-11-20 01:45:48 +01:00
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// Forces an interactive login to get the token for the given account.
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
///// <param name="account">Account to get access token for.</param>
|
|
|
|
|
|
///// <returns>Access token</returns>
|
|
|
|
|
|
//// Task<string> GenerateTokenAsync(MailAccount account);
|
2024-11-20 01:45:48 +01:00
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// ClientId in case of needed for authorization/authentication.
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
//string ClientId { get; }
|
2024-04-18 01:44:37 +02:00
|
|
|
|
}
|