Extension:OATHAuth/ru
The OATHAuth[1] 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 will also guide users.
Установка
- Скачайте и распакуйте файл(ы) в папку с названием
OATHAuth
в вашей папкеextensions/
.
Вместо этого разработчикам и соавторам кода следует установить расширение из Git, используя:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
- Если и только если устанавливаете из git, запустите Composer для установки зависимостей PHP, запустив
composer install --no-dev
в каталоге расширений. (Смотрите T173141 о возможных осложнениях.)Category:Extensions requiring Composer with git/ru - Добавьте следующий код в конце вашего файла LocalSettings.php :
wfLoadExtension( 'OATHAuth' );
- Выполните скрипт обновления, который автоматически создаст необходимые таблицы, используемые расширением.
- Configure as required.
- It is strongly recommended to setup caching when using OATHAuth. This will improve performance, but also the security of your wiki if you're using OATHAuth. If you are only running one application/web server and have php-apcu installed, and no specific cache configured, MediaWiki will likely fallback to using APCu. If you are using multiple application/web server it is advised to set up local cluster caching that all hosts can use. Examples include Memcached .
Готово – Перейдите на страницу 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. After MediaWiki 1.42, you should use $wgVirtualDomainsMapping['virtual-oathauth'] instead of this option. |
$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 login 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 required to enable two-factor authentication. |
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
Сброс пользовательского токена
If a user loses both their token generator and the recovery tokens, two-factor authentication may be removed from the user by running the disableOATHAuthForUser
maintenance script:
Версия MediaWiki: | 1.40 |
$ ./maintenance/run OATHAuth:disableOATHAuthForUser <user>
Версия MediaWiki: | ≤ 1.39 |
$ php ./extensions/OATHAuth/maintenance/disableOATHAuthForUser.php <user>
Where <user>
is the name of the user to have 2FA disabled.
Shared database tables
Some Wikis may want to share the 2FA data amongst multiple Wikis. Shared database tables , the previous method for doing so is deprecated in MediaWiki 1.42 and later. For new wiki-farm installations where you want users to share their 2FA token amongst multiple wikis, please use $wgVirtualDomainsMapping and the extensions will automatically make its tables use the specified database name.
$wgVirtualDomainsMapping['virtual-oathauth'] = [ 'db' => 'sharedbname' ]
When using shared database tables, i.e., the same set of users for different wikis, add oathauth_devices
and oathauth_types
to $wgSharedTables
.
$wgSharedTables[] = 'oathauth_devices';
$wgSharedTables[] = 'oathauth_types';
См. также
References
- ↑ OATH is an acronym for open authentication.
![]() | Это расширение используется в одном или нескольких проектах Викимедиа. Вероятно, это означает, что расширение стабильно и работает достаточно хорошо, чтобы использоваться такими сайтами с высоким трафиком. Найдите название этого расширения в файлах конфигурации Викимедиа CommonSettings.php и InitialiseSettings.php, чтобы узнать, где оно установлено. Полный список расширений, установленных на конкретной вики, можно увидеть на странице Special:Version wiki. |
![]() | Это расширение включено в следующие вики-фермы/хостинги и/или пакеты:
|