class MultiFactorAuthentication extends BaseAuthentication

Constants

ID_PREFIX

Properties

protected int $ttl from  BaseAuthentication

Methods

array
addConfigVarsToModuleInfoArray(array $moduleInfo)

Add correct config_var property to module info array

bool
authenticate_user(string $userid, string $password)

No description

static string
convertFromOldSyntax($auth_method)

Convert xauth_method_name to MethodAuthentication

mixed
getAuthConfig(string $config_var)

Return configuration variable for auth method

static string
getAuthID()

Get internal Auth ID

static AuthenticationInterface|null
getAuthMethod(string $auth_method)

Get Auth Method

int
getSessionTTL()

No description

array
get_module_info()

No description

array
get_user_details()

No description

static void
handleAuthentication()

Handle the MFA authentication, e.g. ask for the second factor and validate it

instance()

Using a singleton pattern here to make sure that we know the state during a request We might see multiple configurations causing the MFA to trigger twice

static bool
isInUse()

Is it generally possible to use MFA? either required or optinally?

static bool
isRequired()

Is a multifactor authentication required for the current request?

static bool
isTOTPAllowed()

Could the user use TOTP to secure the login?

void
onAfterLogin(User $user)

No description

void
onBeforeExecute()

Override in your auth method

Details

in BaseAuthentication at line 78
final protected array addConfigVarsToModuleInfoArray(array $moduleInfo)

Add correct config_var property to module info array

Parameters

array $moduleInfo

Return Value

array

at line 34
bool authenticate_user(string $userid, string $password)

No description

Parameters

string $userid

Username as entered by user

string $password

Password as enetered by user

Return Value

bool

Returns true of authentication is valid

in BaseAuthentication at line 59
final static string convertFromOldSyntax($auth_method)

Convert xauth_method_name to MethodAuthentication

Parameters

$auth_method

Return Value

string

in BaseAuthentication at line 92
final protected mixed getAuthConfig(string $config_var)

Return configuration variable for auth method

Parameters

string $config_var

Return Value

mixed

in BaseAuthentication at line 102
final static string getAuthID()

Get internal Auth ID

Return Value

string

in BaseAuthentication at line 32
final static AuthenticationInterface|null getAuthMethod(string $auth_method)

Get Auth Method

Parameters

string $auth_method

String identifier of Auth Method (XELOS Core or Authentication Hook)

Return Value

AuthenticationInterface|null

in BaseAuthentication at line 21
int getSessionTTL()

No description

Return Value

int

Time in seconds until session can/should be considered expired

at line 81
array get_module_info()

No description

Return Value

array

at line 73
array get_user_details()

No description

Return Value

array

Returns an array containing all user information

at line 236
static void handleAuthentication()

Handle the MFA authentication, e.g. ask for the second factor and validate it

Return Value

void

Exceptions

AuthenticationException

at line 24
static MultiFactorAuthentication instance()

Using a singleton pattern here to make sure that we know the state during a request We might see multiple configurations causing the MFA to trigger twice

at line 112
static bool isInUse()

Is it generally possible to use MFA? either required or optinally?

We need the user and admin to see the respective options in administration and profile

Return Value

bool

at line 145
static bool isRequired()

Is a multifactor authentication required for the current request?

Return Value

bool

at line 135
static bool isTOTPAllowed()

Could the user use TOTP to secure the login?

Return Value

bool

at line 46
void onAfterLogin(User $user)

No description

Parameters

User $user

Return Value

void

Exceptions

AuthenticationException

in BaseAuthentication at line 67
void onBeforeExecute()

Override in your auth method

Return Value

void