Two Factor Authentication - 2FA
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.
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;