NAME
Kernel::System::TwoFactor::HOTPBase
DESCRIPTION
This is the base module for the HOTP
-based two-factor authentication backend modules.
PUBLIC INTERFACE
Auth()
Authenticates user based on the configured two-factor challenge.
my $Success = $Module->Auth( UserLogin => 'agent-1', # (required) User login TwoFactorToken => '4682791', # (optional) Token value );
Returns 1 if two-factor authentication was successful.
GenerateOTP()
Generates OTP
for current user based on the configured two-factor challenge or the given values.
my $OTP = $Module->GenerateOTP( UserLogin => 'agent-1', # (required) User login
or
Secret => 'BKSDNXEHLQAGRYU2', # optional
Counter => 0, # optional
);
Returns generated OTP
:
$OTP = '123456';
Setup()
Setup the two-factor method for the given user.
my $Success = $Module->Setup( UserLogin => 'agent-1', # (required) User login Secret => 'BKSDNXEHLQAGRYU2', Token => '761321', EmailSecurity => 1, # (optional) );
Returns 1 for success.
DeleteSetup()
Delete the setup for the two-factor method for the given user.
my $Success = $Module->DeleteSetup( UserLogin => 'agent-1', # (required) User login );
Returns 1 for success.
IsMethodSetupForUser()
Determines if user has the two-factor authentication method setup.
my $Success = $Module->IsMethodSetupForUser( UserLogin => 'agent-1', # (required) User login );
Returns 1 if user has two-factor authentication method setup.
IsSendingTokenViaTransport()
The token send via transport is enabled for the two-factor authentication methods which use the HOTP
mechanism.
PRIVATE INTERFACE
_IncreaseCounter()
Increases counter value in user preferences, according to the HOTP
mechanism.
my $Success = $Module->_IncreaseCounter( UserLogin => 'agent-1', # (required) User login Counter => 1, # (optional) Counter value to increase, default: 0 CounterPreferencesKey => 'UserHOTPCounterConfig', # (required) Counter preference key );
Returns 1 if counter was successfully incremented.
_DeleteLimitCount()
Delete limit counter value in user preferences, according to the HOTP
mechanism.
my $Success = $Module->_DeleteLimitCount( UserLogin => 'agent-1', # (required) User login );
Returns 1 if counter reset was successful.