* Remove IExternalLoginService.cs * Remove UmbracoApplicationComponentsInstallingNotification.cs * Remove UmbracoApplicationMainDomAcquiredNotification.cs * Merge IContentTypeWithHistoryCleanup with IContentType.cs * Remove obsolete ctors from notifications * Remove obsolete methods * Remove obsolete method from RequestHandlerSettings.cs * Fix UmbracoBuilder.Repositories.cs * RemoveRemove obsolete constants * Remove obsolete method from IRuntimeMinifier * Remove SetLastLogin from IMemberRepository * Revert "RemoveRemove obsolete constants" This reverts commit cddb8ad1cf3d02bd9949d52bed91b45c8d2d66a9. * Remove obsoleted Constants-Conventions.cs * Remove obsolete ctors * Make ContentData properties immutable * remove obsolete static property from TestOptionAttributeBase * Merge IMacroWithAliasService into IMacroService * Remove IUserComposer * remove obsolete AddOEmbedProvider method * remove obsolete static EmbedProvidersCollectionBuilder * remove obsolete HasFlagAll<T> method * Remove obsolete LocalizedTextService property from BaseHttpHeaderCheck * Remove obsolete GetDefaultFIleContent method from ViewHelper * Remove more obsolete ctors and methods * Remove obsolete ctor from RelationType * Remove more obsolete methods * Remove IExternalLoginRepository * merge IMacroWithAliasRepository with IMacroRepository * Remove obsolete methods from ExternalLoginRepository * Remove obsolete method from IUserRepository * Remove obsolete SetLastLogin, as it was NoOp * Remove wierd SetLastLogin method from UserService * Remove GetLogLevel from ILogViewer * Remove more obsolete methods and ctors * Remove more obsoletes * Use other method in BackOfficeServerVariables.cs since GetAllTypes is now removed * Remove obsolete ctor * Remove ConfigureIISServerOptions * Remove more obsolete methods * Merge ITwoFactorLoginService2 with ITwoFactorLoginService * Re-introduce GetCustomGenericProperties in MemberTabsAndPropertiesMapper.cs Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
72 lines
2.6 KiB
C#
72 lines
2.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Umbraco.Cms.Core.Models;
|
|
|
|
namespace Umbraco.Cms.Core.Services
|
|
{
|
|
/// <summary>
|
|
/// Service handling 2FA logins.
|
|
/// </summary>
|
|
public interface ITwoFactorLoginService : IService
|
|
{
|
|
/// <summary>
|
|
/// Deletes all user logins - normally used when a member is deleted.
|
|
/// </summary>
|
|
Task DeleteUserLoginsAsync(Guid userOrMemberKey);
|
|
|
|
/// <summary>
|
|
/// Checks whether 2FA is enabled for the user or member with the specified key.
|
|
/// </summary>
|
|
Task<bool> IsTwoFactorEnabledAsync(Guid userOrMemberKey);
|
|
|
|
/// <summary>
|
|
/// Gets the secret for user or member and a specific provider.
|
|
/// </summary>
|
|
Task<string?> GetSecretForUserAndProviderAsync(Guid userOrMemberKey, string providerName);
|
|
|
|
/// <summary>
|
|
/// Gets the setup info for a specific user or member and a specific provider.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The returned type can be anything depending on the setup providers. You will need to cast it to the type handled by the provider.
|
|
/// </remarks>
|
|
Task<object?> GetSetupInfoAsync(Guid userOrMemberKey, string providerName);
|
|
|
|
/// <summary>
|
|
/// Gets all registered providers names.
|
|
/// </summary>
|
|
IEnumerable<string> GetAllProviderNames();
|
|
|
|
/// <summary>
|
|
/// Disables the 2FA provider with the specified provider name for the specified user or member.
|
|
/// </summary>
|
|
Task<bool> DisableAsync(Guid userOrMemberKey, string providerName);
|
|
|
|
/// <summary>
|
|
/// Validates the setup of the provider using the secret and code.
|
|
/// </summary>
|
|
bool ValidateTwoFactorSetup(string providerName, string secret, string code);
|
|
|
|
/// <summary>
|
|
/// Saves the 2FA login information.
|
|
/// </summary>
|
|
Task SaveAsync(TwoFactorLogin twoFactorLogin);
|
|
|
|
/// <summary>
|
|
/// Gets all the enabled 2FA providers for the user or member with the specified key.
|
|
/// </summary>
|
|
Task<IEnumerable<string>> GetEnabledTwoFactorProviderNamesAsync(Guid userOrMemberKey);
|
|
|
|
/// <summary>
|
|
/// Disables 2FA with Code.
|
|
/// </summary>
|
|
Task<bool> DisableWithCodeAsync(string providerName, Guid userOrMemberKey, string code);
|
|
|
|
/// <summary>
|
|
/// Validates and Saves.
|
|
/// </summary>
|
|
Task<bool> ValidateAndSaveAsync(string providerName, Guid userKey, string secret, string code);
|
|
}
|
|
}
|