Расширение:OATHAuth
![]() Статус релиза: стабильно |
|
---|---|
![]() |
|
Реализация | Права пользователя , Служебная страница , Действие страницы |
Описание | Provides two-factor authentication for logging in |
Автор(ы) | Ryan Lane |
Последняя версия | Постоянные обновления |
Политика совместимости | Snapshots releases along with MediaWiki. Master is not backward compatible. |
MediaWiki | 1.29+ |
Изменения в БД | Да |
Таблицы | oathauth_users |
Лицензия | GPL-2.0-or-later AND GPL-3.0-or-later |
Скачать | |
|
|
Quarterly downloads | 115 (Ranked 80th) |
Public wikis using | 1,804 (Ranked 70th) |
Переведите расширение OATHAuth, если оно доступно на translatewiki.net | |
Проблемы | Открытые задачи · Сообщить об ошибке |
The OathAuth extension provides two-factor authentication support. By default, this includes a time-based one-time password (TOTP) implementation that allows users to generate 2FA codes from their phone or desktop app. Клиент поддерживают большинство телефонов, смартфонов и настольных компьютеров (см. «Реализации клиента»).
Использование
The help page on Two-factor authentication provides information for end users on how to use this extension. However the special page used will also guide users.
Установка
- Скачайте и распакуйте файл(ы) в папку с названием
OATHAuth
в вашей папкеextensions/
. - Если и только если устанавливаете из git, запустите Composer для установки зависимостей PHP, запустив
composer install --no-dev
в каталоге расширений. (Смотрите задача T173141 о возможных осложнениях.) - Добавьте следующий код внизу вашего
LocalSettings.php
:wfLoadExtension( 'OATHAuth' );
- Выполните скрипт обновления, который автоматически создаст необходимые таблицы, используемые расширением.
- Configure as required.
- Готово – Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что расширение успешно установлено.
Настройка
Параметры
Configuration Flag | Значение по умолчанию | Описание |
---|---|---|
$wgOATHAuthWindowRadius
|
4
|
The number of token windows in each direction that should be valid.
This tells OATH to accept tokens for a range of effectively |
$wgOATHAuthDatabase
|
false
|
The database domain. Only used in a multi-database environment. |
$wgOATHAuthSecret
|
false
|
The base OATHAuth secret for this wiki from which all encryption keys are derived.
If |
$wgOATHAuthAccountPrefix
|
false
|
The prefix used for the OATHAuth user account name and the issuer used for the account.
If |
$wgOATHExclusiveRights
|
[]
|
Set of permissions that are revoked from users who did not log in using two-factor authentication. |
$wgOATHRequiredForGroups
|
[]
|
Sets a list of user groups that are required to have two-factor authentication enabled. Use 'user' if you want all logged in users to be required to have two-factor authentication enabled. |
OATHAuth также добавляет ключ в массив $wgRateLimits для определения ограничений скорости для попыток аутентификации:
'badoath' => [
'&can-bypass' => false,
'user' => [ 10, 60 ],
'user-global' => [ 10, 60 ],
]
Note that the user-global
key is available only since 1.35.
Earlier version have to rely on user
and perhaps ip-all
.
See the documentation of $wgRateLimits
for details.
User permission
- Granting access to enable OATHAuth
Users should be given access to the oathauth-enable
user right so that they can enable it at Special:OATHAuth (a link to which appears at Special:Preferences).
$wgGroupPermissions['user']['oathauth-enable'] = true;
The above will grant all registered users access to enable OATHAuth.
Administration
- Сброс пользовательского токена
In the event that a user both loses their token generator AND the recovery tokens; two-factor authentication may be removed from the user by deleting their row from the oathauth_users
database table.
Alternatively, a sysadmin with shell access may type on a command line cd /path/to/mediawiki/extensions/OATHAuth/maintenance/
and then execute php disableOATHAuthForUser.php "username"
where "username"
is the user to have 2FA disabled.
См. также
- Wikimedia Security Team/Two-factor Authentication for CentralAuth wikis
- Two-factor authentication (TFA)
- Extension:WebAuthn
Это расширение используется в одном или нескольких проектах Викимедиа. Вероятно, это означает, что расширение стабильно и работает достаточно хорошо, чтобы использоваться такими сайтами с высоким трафиком. Найдите название этого расширения в файлах конфигурации Викимедиа CommonSettings.php и InitialiseSettings.php, чтобы узнать, где оно установлено. Полный список расширений, установленных на конкретной вики, можно увидеть на странице Special:Version wiki. |
Это расширение включено в следующие пакеты и/или вики-фермы: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |