Search Results for

    Show / Hide Table of Contents
    View Source

    Interface ITwoFactorLoginService

    Service handling 2FA logins.

    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public interface ITwoFactorLoginService : IService

    Methods

    View Source

    DeleteUserLoginsAsync(Guid)

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

    Declaration
    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
    Task<bool> DisableAsync(Guid userOrMemberKey, string providerName)
    Parameters
    Type Name Description
    Guid userOrMemberKey
    System.String providerName
    Returns
    Type Description
    Task<System.Boolean>
    View Source

    DisableWithCodeAsync(String, Guid, String)

    Disables 2FA with Code.

    Declaration
    Task<bool> DisableWithCodeAsync(string providerName, Guid userOrMemberKey, string code)
    Parameters
    Type Name Description
    System.String providerName
    Guid userOrMemberKey
    System.String code
    Returns
    Type Description
    Task<System.Boolean>
    View Source

    GetAllProviderNames()

    Gets all registered providers names.

    Declaration
    IEnumerable<string> GetAllProviderNames()
    Returns
    Type Description
    IEnumerable<System.String>
    View Source

    GetEnabledTwoFactorProviderNamesAsync(Guid)

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

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

    GetSecretForUserAndProviderAsync(Guid, String)

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

    Declaration
    Task<string> GetSecretForUserAndProviderAsync(Guid userOrMemberKey, string providerName)
    Parameters
    Type Name Description
    Guid userOrMemberKey
    System.String providerName
    Returns
    Type Description
    Task<System.String>
    View Source

    GetSetupInfoAsync(Guid, String)

    Gets the setup info for a specific user or member and a specific provider.

    Declaration
    Task<object> GetSetupInfoAsync(Guid userOrMemberKey, string providerName)
    Parameters
    Type Name Description
    Guid userOrMemberKey
    System.String providerName
    Returns
    Type Description
    Task<System.Object>
    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.

    View Source

    IsTwoFactorEnabledAsync(Guid)

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

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

    SaveAsync(TwoFactorLogin)

    Saves the 2FA login information.

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

    ValidateAndSaveAsync(String, Guid, String, String)

    Validates and Saves.

    Declaration
    Task<bool> ValidateAndSaveAsync(string providerName, Guid userKey, string secret, string code)
    Parameters
    Type Name Description
    System.String providerName
    Guid userKey
    System.String secret
    System.String code
    Returns
    Type Description
    Task<System.Boolean>
    View Source

    ValidateTwoFactorSetup(String, String, String)

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

    Declaration
    bool ValidateTwoFactorSetup(string providerName, string secret, string code)
    Parameters
    Type Name Description
    System.String providerName
    System.String secret
    System.String code
    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX