Two Factor Authentication - 2FA: Difference between revisions
Line 1: | Line 1: | ||
== Activate 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): | |||
<pre> | <pre> | ||
$nuConfig2FAAdmin = false; //-- | $nuConfig2FAAdmin = false; //-- Enable 2FA for administrators | ||
$nuConfig2FAUser = false; //-- | $nuConfig2FAUser = false; //-- Enable 2FA for users | ||
$nuConfig2FAFormID = "nuauthentication"; //-- 2FA form ID | $nuConfig2FAFormID = "nuauthentication"; //-- 2FA form ID (default: nuauthentication) | ||
$nuConfig2FATokenValidityTime = 168; //-- | $nuConfig2FATokenValidityTime = 168; //-- Token validity period in hours (default: 7 days) | ||
$nuConfig2FAShowRememberMe = false; //-- Show | $nuConfig2FAShowRememberMe = false; //-- Show "Remember me for X days" checkbox (not yet implemented) | ||
</pre> | </pre> | ||
=== Functionality === | === 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. | |||
[[File:2fa.png]] | [[File:2fa.png]] | ||
=== Setting up 2FA === | === 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: | |||
<pre> | <pre> | ||
$nuConfig2FAAdmin = true; | $nuConfig2FAAdmin = true; | ||
$nuConfig2FAUser = true; | $nuConfig2FAUser = true; | ||
</pre> | </pre> |
Latest revision as of 12:35, 10 June 2024
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;