Two Factor Authentication - 2FA

From nuBuilderForte
Revision as of 12:35, 10 June 2024 by Kev1n (talk | contribs) (→‎Activate 2FA)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Activate 2FA

To activate two-factor authentication (2FA), configure the nuconfig.php file using the following settings. By default, these settings are disabled (set to false):

$nuConfig2FAAdmin             = false;              //-- Enable 2FA for administrators
$nuConfig2FAUser              = false;              //-- Enable 2FA for users
$nuConfig2FAFormID            = "nuauthentication"; //-- 2FA form ID (default: nuauthentication)
$nuConfig2FATokenValidityTime = 168;                //-- Token validity period in hours (default: 7 days)
$nuConfig2FAShowRememberMe    = false;              //-- Show "Remember me for X days" checkbox (not yet implemented)

Functionality

When 2FA is enabled, users are redirected to an authentication form after logging in. On this form, users can request a 2FA token, which is sent via email (or SMS). Entering a valid token allows redirection to the intended form. Users cannot access other forms until authenticated. Authentication remains valid for the "Token Validity Time" on the same machine and browser. 2fa.png

Setting up 2FA

Navigate to Home -> Builders -> PHP Procedure "nuAuthentication2FA_Template" Clone the template. The procedure code will automatically be renamed to nuAuthentication2FA. Adapt the PHP code as needed and save it. Configure the nuconfig.php variables as follows:

$nuConfig2FAAdmin = true;
$nuConfig2FAUser = true;