Search Results for

    Show / Hide Table of Contents
    View Source

    Class TwoFactorLoginService

    Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public class TwoFactorLoginService : ITwoFactorLoginService, IService

    Constructors

    View Source

    TwoFactorLoginService(ITwoFactorLoginRepository, ICoreScopeProvider, IEnumerable<ITwoFactorProvider>, IOptions<IdentityOptions>, IOptions<BackOfficeIdentityOptions>, ILogger<TwoFactorLoginService>)

    Initializes a new instance of the TwoFactorLoginService class.

    Declaration
    public TwoFactorLoginService(ITwoFactorLoginRepository twoFactorLoginRepository, ICoreScopeProvider scopeProvider, IEnumerable<ITwoFactorProvider> twoFactorSetupGenerators, IOptions<IdentityOptions> identityOptions, IOptions<BackOfficeIdentityOptions> backOfficeIdentityOptions, ILogger<TwoFactorLoginService> logger)
    Parameters
    Type Name Description
    ITwoFactorLoginRepository twoFactorLoginRepository
    ICoreScopeProvider scopeProvider
    IEnumerable<ITwoFactorProvider> twoFactorSetupGenerators
    IOptions<IdentityOptions> identityOptions
    IOptions<BackOfficeIdentityOptions> backOfficeIdentityOptions
    ILogger<TwoFactorLoginService> logger

    Methods

    View Source

    DeleteUserLoginsAsync(Guid)

    Deletes all user logins - normally used when a member is deleted.

    Declaration
    public Task DeleteUserLoginsAsync(Guid userOrMemberKey)
    Parameters
    Type Name Description
    Guid userOrMemberKey
    Returns
    Type Description
    Task
    View Source

    DisableAsync(Guid, string)

    Disables the 2FA provider with the specified provider name for the specified user or member.

    Declaration
    public Task<bool> DisableAsync(Guid userOrMemberKey, string providerName)
    Parameters
    Type Name Description
    Guid userOrMemberKey
    string providerName
    Returns
    Type Description
    Task<bool>
    View Source

    GenerateSecret()

    Generates a new random unique secret.

    Declaration
    protected virtual string GenerateSecret()
    Returns
    Type Description
    string

    The random secret

    View Source

    GetAllProviderNames()

    Gets all registered providers names.

    Declaration
    public IEnumerable<string> GetAllProviderNames()
    Returns
    Type Description
    IEnumerable<string>
    View Source

    GetEnabledTwoFactorProviderNamesAsync(Guid)

    Gets all the enabled 2FA providers for the user or member with the specified key.

    Declaration
    public Task<IEnumerable<string>> GetEnabledTwoFactorProviderNamesAsync(Guid userOrMemberKey)
    Parameters
    Type Name Description
    Guid userOrMemberKey
    Returns
    Type Description
    Task<IEnumerable<string>>
    View Source

    GetSecretForUserAndProviderAsync(Guid, string)

    Gets the secret for user or member and a specific provider.

    Declaration
    public Task<string?> GetSecretForUserAndProviderAsync(Guid userOrMemberKey, string providerName)
    Parameters
    Type Name Description
    Guid userOrMemberKey
    string providerName
    Returns
    Type Description
    Task<string>
    View Source

    IsTwoFactorEnabledAsync(Guid)

    Checks whether 2FA is enabled for the user or member with the specified key.

    Declaration
    public Task<bool> IsTwoFactorEnabledAsync(Guid userOrMemberKey)
    Parameters
    Type Name Description
    Guid userOrMemberKey
    Returns
    Type Description
    Task<bool>
    View Source

    SaveAsync(TwoFactorLogin)

    Saves the 2FA login information.

    Declaration
    public Task SaveAsync(TwoFactorLogin twoFactorLogin)
    Parameters
    Type Name Description
    TwoFactorLogin twoFactorLogin
    Returns
    Type Description
    Task
    View Source

    ValidateTwoFactorSetup(string, string, string)

    Validates the setup of the provider using the secret and code.

    Declaration
    public bool ValidateTwoFactorSetup(string providerName, string secret, string code)
    Parameters
    Type Name Description
    string providerName
    string secret
    string code
    Returns
    Type Description
    bool
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX