Two Factor Authentication - 2FA: Difference between revisions

From nuBuilderForte
Jump to navigation Jump to search
 
Line 1: Line 1:
== Activate 2FA ==
== Activate 2FA ==
This is done in the '''nuconfig.php''' file using these setting parameters (true) whose default values when disabled are:
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;              //-- Use 2FA authentication for administrator
$nuConfig2FAAdmin            = false;              //-- Enable 2FA for administrators
$nuConfig2FAUser              = false;              //-- Use 2FA authentication for users
$nuConfig2FAUser              = false;              //-- Enable 2FA for users
$nuConfig2FAFormID            = "nuauthentication"; //-- 2FA form ID. Default form ID: nuauthentication
$nuConfig2FAFormID            = "nuauthentication"; //-- 2FA form ID (default: nuauthentication)
$nuConfig2FATokenValidityTime = 168;                //-- 2FA Token Validity Time in hours. Default: 7 days (7 * 24 hours)
$nuConfig2FATokenValidityTime = 168;                //-- Token validity period in hours (default: 7 days)
$nuConfig2FAShowRememberMe    = false;              //-- Show a checkbox "Remember me for X days" in the authentication form (not implemented yet)
$nuConfig2FAShowRememberMe    = false;              //-- Show "Remember me for X days" checkbox (not yet implemented)
</pre>
</pre>
=== Functionality ===
=== Functionality ===
* If the 2FA authentication is active, a user is redirected to an authentication form after logging in.
* On that form, a two-factor authentication token can be requested, which will be sent by email (or SMS).
* If a valid token is entered, redirection to the actual form will occur.
* One cannot open any other form until authenticated.
* No need to authenticate again after a successful login during the "Token Validity Time" (same machine, browser)


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"'''
Navigate to '''Home -> Builders -> PHP Procedure "nuAuthentication2FA_Template"'''
* Clone it. The procedure Code is automatically renamed to nuAuthentication2FA.
Clone the template. The procedure code will automatically be renamed to nuAuthentication2FA.
* Adapt the PHP code to your needs and save it.
Adapt the PHP code as needed and save it.
 
Configure the '''nuconfig.php''' variables as follows:
* Setup the '''nuconfig.php''' variables above as appropriate like:
<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. 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;