Commit graph

79 commits

Author SHA1 Message Date
Amir E. Aharoni b5bb50a0ae Simplify the message notification-body-oathauth-oathauth-recoverycodesleft
Make it less repetitive and add a missing word.

Change-Id: Ie8e512de2b4d48cce109d0a3e3505d8ea0bfde3f
2024-11-05 23:24:10 +00:00
Taavi Väänänen e5bcf09868
Allow injecting services to Modules
And as a bonus tweak OATHModuleRegistry error handling.

Change-Id: I4e3ca0092115e22ab7e7703e1682d68fbcc06af4
2024-11-04 18:32:14 +02:00
jenkins-bot dc63d00723 Merge "TOTPEnableForm: Display enrollment timestamp with recovery tokens" 2024-11-03 11:08:53 +00:00
jenkins-bot d8a3d0ed10 Merge "Display help on OATHToken field" 2024-11-02 16:01:36 +00:00
jenkins-bot 098c55106f Merge "OATHManage: Add messages to signify 2FA auth is needed to continue action" 2024-11-02 15:58:55 +00:00
Reedy 790660802b Display help on OATHToken field
Bug: T354539
Change-Id: I9f4598fc5044ce57898418fed53fb609013837f6
2024-11-02 15:45:31 +00:00
Reedy a8c58f56f4 TOTPEnableForm: Display enrollment timestamp with recovery tokens
Bug: T234004
Change-Id: Ic708552fffdd2260e2f270b484c28ca47a9f4c03
2024-11-02 15:37:20 +00:00
Reedy 5d5c9365c7 OATHManage: Add messages to signify 2FA auth is needed to continue action
Bug: T354538
Change-Id: I242dad188c94ec59c4a181f72cf9e3cd0d6f3529
2024-11-02 10:37:47 +00:00
Reedy 8eb5725494 Add notification when user is running out of recovery codes
Bug: T131788
Change-Id: Ic4294dc4ca8eb238998af3ec6b69a771f1b17c17
2024-10-30 02:04:36 +00:00
Gergő Tisza b760e3f6e4
Add download link for recovery codes
Bug: T245027
Change-Id: I558fa2aaed90afee8488f8b68c71959e3c75331d
2024-05-08 13:42:29 +02:00
Reedy b526b0eb18 oathauth-recoverycodes: Force some text onto a newline
Makes it stand out a bit more, rather than being trailing bold text on a line

Change-Id: Ia7431b436d46e08dec3b94b05613ba91f95fdea0
2024-01-12 15:53:10 +00:00
Taavi Väänänen c18f6962de notifications: Show number of remaining devices
Bug: T353962
Change-Id: I519d1cdefa322b5bb729b21c0c6325a4dfe991c4
2024-01-11 23:49:14 +00:00
James D. Forrester 3b67ee9d4f i18n: Drop three unused messages
* specialpages-group-oath

  This was for grouping the OATHAuth special pages in their own section, but
  we have them in the general users and rights (specialpages-group-users) one
  instead.

* oathauth-token

  Removed as part of the post-AuthManager clean-up (e38c68c).

* oathauth-invalid-key-type

  Used to be thrown from maintenance/UpdateForMultipleDevicesSupport.php
  until that support was moved into the database (6ef3d24).

Bug: T354549
Change-Id: I033dbb054733ad88257ef334f451b9ac21430904
2024-01-11 16:27:23 -05:00
Reedy a5851432f7 TOTPDisableForm: Add a hint message that user can use recovery tokens
Bug: T189924
Change-Id: I4a2d7ccbd43810adc285e6d9f76e331344e43de6
2024-01-11 14:58:56 +00:00
James D. Forrester 217674f561 i18n: Rename the recovery code i18n messages to match
Follows-Up: Icf8626799615f8b95f380db9745e1447519b150a
Follows-Up: Ida71577719afbc1232cf1fd072503e2d3b8981bd
Change-Id: I9e788d2aa2b139cfb4c344ad424eb6a2586c33c4
2024-01-11 08:46:56 -05:00
Reedy 9039300635 TOTPEnableForm: Emphasise importance of recovery codes
Bug: T174937
Change-Id: Ida71577719afbc1232cf1fd072503e2d3b8981bd
2024-01-11 08:46:56 -05:00
Reedy 16058b456a Standardised UI strings to use "recovery codes"
This normalises the uses of "tokens" and "scratch"

Not changing all interal usages of "scratch"; comments
and some variables updated. Functions not updated.

Bug: T354031
Change-Id: Icf8626799615f8b95f380db9745e1447519b150a
2024-01-08 16:34:04 +00:00
Reedy d4cc647595 oathauth-step1-test: Improve examples (and add links) of 2FA apps
Bug: T226059
Change-Id: I13ccf55016f6ca212142ce2a4290255f2890e023
2024-01-04 10:30:05 +00:00
Reedy ca3b49b86f TOTPEnableForm: Add message for step 2 before qr code image
Change-Id: Ifdacc045b5796c53061ab7b4f5ef44e4ade310a2
2024-01-03 17:07:24 +00:00
jenkins-bot b68254ee6f Merge "TOTPEnableForm: Reorder manual step and improve oathauth-step2alt" 2023-12-27 11:30:01 +00:00
Reedy f773fa040c TOTPEnableForm: Reorder manual step and improve oathauth-step2alt
Bug: T226060
Change-Id: I332c3cd53d5ba3351c5316a1cf67485b513520bb
2023-12-26 22:40:23 +00:00
Reedy c9b9c9601d en.json: Improve oathauth-scratchtokens
* Replace "phone" with "device"
* Advise users to mark scratch tokens as used upon usage
* Advice users they're for emergency usage when no access to device

Bug: T150564
Bug: T150868
Bug: T174937
Change-Id: Icd11a4fe00dd63430640ed9d01bc1c30f3c7ca88
2023-12-26 22:00:51 +00:00
Derk-Jan Hartman 55b465c196 Provide an alt label to the SVG qr code
The raw svg was represented to a11y dom as 256x256 images (due to
the 'use'). Convert the raw SVG to a base64 encoded img data uri and
provide it with an alt attribute describing the function.

While the qr code is duplicate with the 'manual' code below it, it is
not decorative so should not suppress alt. It's a big image and if
you use touch interaction, it would create a big blank spot. It is
useful to know for users that the QR code is there.

The img wrapping should also make the SVG usage slightly safer. It
avoids any potential remote resource usage from inside the SVG. While
this is not a direct danger right now, compromised php packages can
happen, and this limits the impact in that case.

Bug: T151550
Change-Id: I568927ace95a1fdf9cd7990bc7de8461718aa1c1
2023-12-26 14:46:45 +00:00
Reedy 4484acf5eb Add missing oathauth-notifications-(dis|en)able-primary messages
Bug: T210075
Bug: T210963
Bug: T301987
Bug: T326073
Change-Id: If4fe85ebc5e7fdd1ec22ede14a9b88bbcda13228
Follows-Up: I99077ea082b8483cc4fd77573a0d00fa98201f15
Follows-Up: I0fe32b735e34753442ec9811ea41d15b76999d87
2023-11-08 17:45:15 +00:00
MarcoAurelio da8f0445f8 Fix typo: s/to log/the log/
See e.g. `abusefilter-log` or `checkuser-log` for a similar wording.

Change-Id: Ibdc11631df71bab6f1a73d743189919e5b7e89ba
2023-03-28 18:00:52 +00:00
Kunal Mehta c896015a44 Allow filtering Special:Log/oath by action
Configure "ActionFilteredLogs" in extension.json to allow filtering
the oath log by its two actions, verify ("checking" in the UI) and
disable-other.

== Test plan ==
* Enable 2FA on your administrator account, use Special:VerifyOATHForUser
  and Special:VerifyOATHForUser to generate two log entries.
* Visit Special:Log/oath and use the new action selector, testing each
  state to verify the correct set of logs are shown.
* Screenshots showing this testing are posted at T310487#7999991.

Bug: T310487
Change-Id: I10632c86689e330b21b44a096b098436ebe47e3e
2022-06-13 14:28:22 -04:00
Reedy b5a762d7fe Rename oauthauth-ui-no-module
Change-Id: I23a05cd04756b87d0a97db32ddedc1ea8af0c1b7
2022-04-02 21:39:07 +00:00
Reedy 16bc5d7168 Send a notification when 2FA is enabled
Bug: T301987
Change-Id: I0fe32b735e34753442ec9811ea41d15b76999d87
2022-02-24 00:39:37 +00:00
Kunal Mehta 329c3133d6 Send a notification when 2FA is disabled
Notify users when 2FA is disabled on their account in case something was
fishy about it. This notification is a "system" notification that will
be displayed in the web UI and sent over email. It can't be opted out of
as a preference.

The notification links to Special:Preferences, where users can see their
2FA status and re-enable it if they want. A secondary help link goes to
[[mw:Help:Two-factor authentication]], but can be overridden by
adjusting the "oathauth-notifications-disable-helplink" message. The
notification text is different based on whether the user disabled 2FA on
their own, or an admin used the special page or a maint script to do it.

On Wikimedia wikis, we'll use the WikimediaMessages extension to
customize the messages.

The Echo (Notifications) extension is not required, this will gracefully
do nothing if it's not enabled.

Bug: T210075
Bug: T210963
Change-Id: I99077ea082b8483cc4fd77573a0d00fa98201f15
2022-02-17 00:14:20 -08:00
Kunal Mehta 498dcfeb80 Require OATHAuth for membership in specified user groups
Users in groups listed in $wgOATHRequiredForGroups (default none) must
have two-factor authentication enabled otherwise their membership in
those groups will be disabled. This is done using the
UserEffectiveGroups hook, which allows dynamically adding or removing
user groups.

If a user doesn't have 2FA enabled, it will appear to them as if they
aren't a member of the group at all. Special:Preferences will show which
groups are disabled. In the future it would be good to have a hook into
PermissionsError to show this as well. The UserGetRights hook is used to
ensure the user still has the "oathauth-enable" user right in case it
was only granted to them as part of the user group they are disabled
from.

On the outside, Special:ListUsers will still show the user as a member
of the group. The API list=users&prop=groups|groupmemberships will show
inconsistent informaiton, groups will remove disabled groups while
groupmemberships will not.

This functionality was somewhat already available with
$wgOATHExclusiveRights, except that implementation has flaws outlined at
T150562#6078263 and haven't been resolved in I69af6a58e4 for over a year
now. If this works out, it's expected that will be deprecated/removed.

Bug: T150562
Change-Id: I07ebddafc6f2233ccec216fa8ac6e996553499fb
2022-02-14 00:47:20 -08:00
Martin Urbanec cab4f104c9 [i18n] Add a period to "oathauth-disable-method-warning"
Sentences usually end with a period.

Bug: T261597
Change-Id: I85c3378cef65b2ce5d7ced90d8a1108f814c1794
2020-10-09 19:03:42 +00:00
DannyS712 635fba26b7 Add missing message verifyoathforuser
Bug: T209749
Change-Id: I0494dc670db9cd05fd0646b97a96618c84d6e1e2
2020-05-23 15:26:46 +00:00
DannyS712 130e649191 Add Special:VerifyOATHForUser to check if users have OATH enabled
Bug: T209749
Change-Id: Idbac3940b36ce21a0b40044482514a28c5fbd45f
2020-04-22 00:47:22 +00:00
zoranzoki21 e1d6ac5053 Add missing oathauth-module-invalid message
Bug: T228269
Change-Id: I7f3ceaf27cb13bbf1acc0e7784f405fef35e3001
2019-11-09 18:17:43 +00:00
Dejan Savuljesku 920136e67b Do not store proper objects in session data
Bug: T233146
Change-Id: I2f75261b276993d27f6c96e066ea7769cf7fc082
2019-10-16 13:04:49 +02:00
Dejan Savuljesku 8ca4dabd70 Add warning page before method gets disabled
- When explictly disabling a method
- When method is implicity disabled if user switches to another method

Bug: T232008
Change-Id: I97a96ca7c1935ecb3a81aea35f607b8ff9f8817d
2019-09-28 16:22:41 +00:00
Dejan Savuljesku 630a17da01 UI upgrade
Help messages for 2FA in general and for TOTP module are taken from Wikipedia.
Those could probably be improved, any suggestions are welcome

Bug: T218214
Bug: T226056
Change-Id: Ifc81a3c0e1adc9f6d0d49e7eee086714fc2c0f81
2019-08-29 10:38:10 +00:00
jenkins-bot cfe1f744e8 Merge "Remove orphaned oathauth-ui-error-page-no-module message" 2019-07-31 15:50:51 +00:00
Dejan Savuljesku 6c09ac0c53 Allow revocation of user rights if 2FA isn't enabled on an account
Bug: T199118
Bug: T218215

Change-Id: I7036dd0d95598b90654a1fcf3130c6bdc6b635b4
2019-07-31 13:36:33 +00:00
Reedy cbda0da987 Remove orphaned oathauth-ui-error-page-no-module message
Bug: T226058
Change-Id: I9c846ac57576b8d357d25cb7462ba27638c679c4
2019-07-31 14:29:38 +01:00
MarcoAurelio f24600d153 Add final dot to oathauth-auth-ui
This is the message that displays right after successfully
introducing username and password. It appears standalone in
a box and misses the final dot.

Change-Id: I7911bb0f9c2ab30756ff53d96d6bda3df6e822b0
2019-07-20 10:13:52 +00:00
Amir Aharoni 53251f752c Split apihelp messages to a separate file
Bug: T189982
Change-Id: I04f84c10c99de9bdd5d7b9828e852615488328db
2019-07-04 20:09:00 +01:00
rvogel b9f768e20a Refactor includes to src #2
Bug: T218210

Change-Id: I079e6e819c079b68bbfecdac0d873b26d4e16e86
2019-07-04 13:36:13 +00:00
rvogel b04722a1eb Rework the way user interacts with 2FA settings
Bug: T218210

Change-Id: Iaa6f6ae1c25f47ef43a0e6467474284d89a7a213
2019-07-04 12:45:27 +00:00
Dejan Savuljesku ea984e5c2b Refactor the extension to support multiple auth modules
Please note, this patch requires a schema change before merging

Change-Id: I71286534d21d95083436d64d79811943c1a1d032
ERM: #14484
Bug: T218210
2019-06-18 10:45:21 +00:00
Amir Aharoni c45d9c35aa Add the possessive apostrophe
If I understand correctly, the messages is about the
"two-factor authentication status of users", so it should
be written as possessive.

Change-Id: I084029d6cdf6288b904f22e9ed2e098a42dbefb0
2019-04-14 13:05:55 +03:00
Reedy f7ab8e724e Add action-oathauth-disable-for-user
Bug: T220778
Change-Id: I5097d0c294e11502a6dbc8be25eee5c98138025f
2019-04-12 14:10:03 +01:00
Amir Sarabadani 808df6dc55 Add private logging when user disables 2fa for someone else
It's better that we add for when someone enables or disables for self too
But that can be done in a follow-up patch

Bug: T180896
Change-Id: Ic173ebb7e39d22e40fea23c2b906d246adef1e05
2019-04-12 12:10:43 +00:00
MarcoAurelio 40c119c172 Add missing 'oathauth-user-not-found' i18n key
Follow-up on Ibd2f5339.

Bug: T216415
Change-Id: Id3ac2a9d8f9f9275ab8d8bf0d408a11fbc070fec
2019-04-04 23:15:53 +00:00
mnavya 5ec38a027b Added missing disableoathforuser message
Bug: T216411
Change-Id: I86080005a0fbef6cd903989f4d2a0bf513c592a5
2019-03-03 14:37:13 +00:00