using System; using System.Collections.Generic; using System.Threading.Tasks; using Bit.Core.Enums; using Bit.Core.Models.Domain; using Bit.Core.Models.Request; using Bit.Core.Models.Response; namespace Bit.Core.Abstractions { public interface IAuthService { string Email { get; set; } string MasterPasswordHash { get; set; } string Code { get; set; } string CodeVerifier { get; set; } string SsoRedirectUrl { get; set; } TwoFactorProviderType? SelectedTwoFactorProviderType { get; set; } Dictionary TwoFactorProviders { get; set; } Dictionary> TwoFactorProvidersData { get; set; } TwoFactorProviderType? GetDefaultTwoFactorProvider(bool fido2Supported); bool AuthingWithSso(); bool AuthingWithPassword(); List GetSupportedTwoFactorProviders(); Task LogInAsync(string email, string masterPassword, string captchaToken); Task LogInSsoAsync(string code, string codeVerifier, string redirectUrl, string orgId); Task LogInCompleteAsync(string email, string masterPassword, TwoFactorProviderType twoFactorProvider, string twoFactorToken, bool? remember = null); Task LogInTwoFactorAsync(TwoFactorProviderType twoFactorProvider, string twoFactorToken, string captchaToken, bool? remember = null); Task LogInPasswordlessAsync(string email, string accessCode, string authRequestId, byte[] decryptionKey, string userKeyCiphered, string localHashedPasswordCiphered); Task> GetPasswordlessLoginRequestsAsync(); Task GetPasswordlessLoginRequestByIdAsync(string id); Task GetPasswordlessLoginResponseAsync(string id, string accessCode); Task PasswordlessLoginAsync(string id, string pubKey, bool requestApproved); Task PasswordlessCreateLoginRequestAsync(string email); void LogOut(Action callback); void Init(); } }