Kernel::WebApp::Util::TwoFactor

NAME

Kernel::WebApp::Util::TwoFactor – Two-factor authentication utility methods.

PUBLIC INTERFACE

has UserType

Attribute that holds to the type of user to handle.

has UserLogin

Attribute that holds the user login/username.

has TwoFactorMethods

Attribute that holds the available two-factor methods.

TwoFactorMethodObject()

The /TwoFactorMethodObject() method loads the object for the given two-factor method.

TwoFactorAvailableMethods()

Get a list for the configured two-factor methods.

    my @TwoFactorAvailableMethods = $TwoFactorObject->TwoFactorAvailableMethods(
        OnlySetupForUser => 1,
        SetupValues      => 1,
    );

Returns

    @TwoFactorAvailableMethods = (
        {
            Method                         => 'AuthenticatorApp',
            Label                          => 'App',
            Icon                           => 'bold,rating-star',
            RequestVerificationCodeMessage => {
                Message     => 'Request verification code to %s',
                Placeholder => 'example@localhost.com',
            },
        },
    );

TwoFactorSetupRequired()

Checks if two-factor authentication setup is required for a specific user.

    my $TwoFactorSetupRequired = $TwoFactorObject->TwoFactorSetupRequired(
        UserLogin                 => 'agent-1', # (required) User login
        CheckIsMethodSetupForUser => 0,         # (optional) default is 1
    );

Returns 1 if two-factor authentication is required.

DefaultTwoFactorMethod()

Get the default two-factor authentication method for the user.

    my $TwoFactorMethod = $TwoFactorObject->DefaultTwoFactorMethod();

Returns

    $TwoFactorMethod = 'Email';

PRIVATE INTERFACE

has _TwoFactorObject

Attribute that holds the two-factor method object (agent or customer flavor).

has _LookupTwoFactorMethodObjects

Attribute that holds the two-factor method objects (Kernel::WebApp::Util::TwoFactor::/TwoFactorMethod()).

_BuildTwoFactorObject()

The /_BuildTwoFactorObject() method will create an instance of the Kernel::System::TwoFactor object.

_BuildTwoFactorMethods()

The /_BuildTwoFactorMethods() method will create a list of available two-factor methods.

Scroll to Top