diff --git a/core/user_2fa_otp_config.js b/core/user_2fa_otp_config.js index e66f077b..61ef0a0c 100644 --- a/core/user_2fa_otp_config.js +++ b/core/user_2fa_otp_config.js @@ -31,20 +31,19 @@ const FormIds = { }; const MciViewIds = { - enableToggle : 1, - otpType : 2, - submit : 3, - infoText : 4, + enableToggle : 1, + otpType : 2, + submit : 3, customRangeStart : 10, // 10+ = customs }; const DefaultMsg = { infoText: { - disabled : 'Enabling 2-Factor Authentication via One-Time-Password can greatly increase the security of your account.', + disabled : 'Enabling 2-Factor Authentication via One-Time-Password (2FA/OTP) can greatly increase the security of your account.', enabled : 'A valid email address set in user config is required to enable 2-Factor Authentication.', rfc6238_TOTP : 'Time-Based One-Time-Password (TOTP, RFC-6238).', - rfc4266_HOTP : 'HMAC-Based One-Time-Passowrd (HOTP, RFC-4266).', + rfc4266_HOTP : 'HMAC-Based One-Time-Password (HOTP, RFC-4266).', googleAuth : 'Google Authenticator.', }, statusText : { diff --git a/docs/_includes/nav.md b/docs/_includes/nav.md index e67f1163..5ecbe58e 100644 --- a/docs/_includes/nav.md +++ b/docs/_includes/nav.md @@ -25,6 +25,7 @@ - [Colour Codes]({{ site.baseurl }}{% link configuration/colour-codes.md %}) - [Access Condition System (ACS)]({{ site.baseurl }}{% link configuration/acs.md %}) - [Event Scheduler]({{ site.baseurl }}{% link configuration/event-scheduler.md %}) + - [Security]({{ site.baseurl }}{% link configuration/security.md %}) - Scheduled jobs - File Base @@ -83,6 +84,7 @@ - [Set Newscan Date]({{ site.baseurl }}{% link modding/set-newscan-date.md %}) - [Node to Node Messaging]({{ site.baseurl }}{% link modding/node-msg.md %}) - [Top X]({{ site.baseurl }}{% link modding/top-x.md %}) + - [2FA/OTP Config]({{ site.baseurl }}{% link modding/user-2fa-otp-config.md %}) - Administration - [oputil]({{ site.baseurl }}{% link admin/oputil.md %}) diff --git a/docs/modding/top-x.md b/docs/modding/top-x.md index 50d69bee..41ac5ab7 100644 --- a/docs/modding/top-x.md +++ b/docs/modding/top-x.md @@ -48,7 +48,7 @@ mciMap: { } ``` -### Theming +## Theming Generally `mciMap` entries will point to a Vertical List View Menu (`%VM1`, `%VM2`, etc.). The following `itemFormat` object is provided: * `value`: The value acquired from the supplied data source. * `userName`: User's username. diff --git a/docs/modding/user-2fa-otp-config.md b/docs/modding/user-2fa-otp-config.md new file mode 100644 index 00000000..499f6083 --- /dev/null +++ b/docs/modding/user-2fa-otp-config.md @@ -0,0 +1,51 @@ +--- +layout: page +title: TopX +--- +## The 2FA/OTP Config Module +The `user_2fa_otp_config` module provides opt-in, configuration, and viewing of Two-Factor Authentication via One-Time-Password (2FA/OTP) settings. For more information on 2FA/OTP see [Security](/docs/configuration/security.md). + +## Configuration + +### Config Block +Available `config` block entries: +* `infoText`: Overrides default informational text string(s). See **Info Text** below. +* `statusText:` Overrides default status text string(s). See **Status Text** below. + +Example: +```hjson +config: { + infoText: { + googleAuth: Google Authenticator available on mobile phones, etc. + } + statusText: { + saveError: Doh! Failed to save :( + } +} +``` + +#### Info Text (infoText) +Overrides default informational text relative to current selections. Available keys: +* `disabled`: Displayed when OTP switched to enabled. +* `enabled`: Displayed when OTP switched to disabled. +* `rfc6238_TOTP`: Describes TOTP. +* `rfc4266_HOTP`: Describes HOTP. +* `googleAuth`: Describes Google Authenticator OTP. + +#### Status Text (statusText) +Overrides default status text for various conditions. Available keys: +* `otpNotEnabled` +* `noBackupCodes` +* `saveDisabled` +* `saveEmailSent` +* `saveError` +* `qrNotAvail` +* `emailRequired` + +## Theming +The following MCI codes are available: +* MCI 1: (ie: `TM1`): Toggle 2FA/OTP enabled/disabled. +* MCI 2: (ie: `SM2`): 2FA/OTP type selection. +* MCI 3: (ie: `TM3`): Submit/cancel toggle. +* MCI 10...99: Custom entries with the following format members available: + * `{infoText}`: **Info Text** for current selection.