Jump to content
MediaWiki

Extension:OATHAuth

From mediawiki.org
This page is a translated version of the page Extension:OATHAuth and the translation is 5% complete.
Nesmí se zaměňovat s: Extension:OAuth.
Příručka k rozšířením MediaWiki
OATHAuth
Stav rozšíření: stabilní
Implementace Uživatelská práva , Speciální stránka , Akce stránky
Popis Nabízí dvoufaktorové ověřování pro přihlášení
Autoři Ryan Lane
Nejnovější verze Průběžně aktualizováno
Zásady kompatibility Vydání snímků současně s MediaWiki. Hlavní vývojová větev není zpětně kompatibilní.
Změny v databázi Ano
Tabulky oathauth_types
oathauth_devices
oathauth_users
Licence GPL-2.0-or-later AND GPL-3.0-or-later
Stáhnout
  • $wgOATHRequiredForGroups
  • $wgOATHMaxKeysPerUser
  • $wgOATHAuthWindowRadius
  • $wgOATHRecoveryCodesCount
  • $wgOATHAuthAccountPrefix
  • $wgOATHSecretKey
  • $wgOATHNewPasskeyFeatures
  • $wgOATHExclusiveRights
  • $wgOATHPrioritizedModules
  • oathauth-enable
  • oathauth-api-all
  • oathauth-disable-for-user
  • oathauth-view-log
  • oathauth-verify-user
Přeložte rozšíření OATHAuth, používá-li lokalizaci z translatewiki.net
Problémy Otevřené úkoly · Nahlásit chybu

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. Client support is available for most feature phones, smartphones, and desktops.

This extension has nothing to do with OAuth, which is a totally different protocol.

Usage

The help page on Two-factor authentication provides information for end users on how to use this extension.

Some policies explained on Two-factor authentication only apply to Wikimedia projects. However, the basic instructions for using 2FA are the same for any wiki that uses Extension:OATHAuth.

The Special:AccountSecurity page guides users through adding and managing their two-factor authentication methods and recovery codes.

Installation

Toto rozšíření je součástí MediaWiki 1.31 a vyšší. Zbývající konfigurační pokyny je stále nutné dodržovat.
Varování Varování: There is a bug with this extension where it does not update properly from the web (mw-config) updater and must instead use the update.php command line update script (phab:T371849)
  • Stáhněte soubor/y a vložte je do adresáře pojmenovaného OATHAuth ve vaší složce extensions/.
    Vývojáři a přispěvatelé kódu by si místo toho měli nainstalovat rozšíření from Git pomocí:
    cdextensions/
    gitclonehttps://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
    
  • Při instalaci z Gitu spusťte Composer pro instalaci závislostí PHP zadáním composer install --no-dev v adresáři rozšíření. (Vyskytnou-li se nějaké komplikace, podívejte se na T173141.)
  • Na konec vašeho souboru LocalSettings.php přidejte následující kód:
    wfLoadExtension( 'OATHAuth' );
    
  • Spusťte aktualizační skript , který automaticky provede všechny nezbytné databázové změny, jaké rozšíření vyžaduje.
  • 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 .
  • Yes Dokončeno – Přejděte na stránku Special:Version vaší wiki a zkontrolujte, zda bylo rozšíření úspěšně nainstalováno.

Configuration

Parameters

Configuration Flag Default Value Description
$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 ((1 + 2 * $wgOATHAuthWindowRadius) * 30) seconds. This range of valid windows is centered around the current time. The purpose of this configuration variable is to account for differences between the user's and server's clock. However, keeping it as low as possible is recommended.

$wgOATHAuthDatabase false (zastaralé) The database domain. Only used in a multi-database environment. After MediaWiki 1.42, you should use $wgVirtualDomainsMapping['virtual-oathauth'] instead of this option.
$wgOATHAuthAccountPrefix false The prefix used for the OATHAuth user account name and the issuer used for the account.

If false, the value of $wgSitename is used.

$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.
$wgOATHRolloutPercent 0 Percentage of users to add to two-factor authentication rollout.
$wgOATHAllowMultipleModules false (zastaralé) Temporary (in the MW 1.45 development cycle) feature flag to allow users to have multiple two-factor authentication modules active at the same time.
$wgOATHAuthNewUI false (zastaralé) Temporary (in the MW 1.45 development cycle) feature flag for the redesigned UI. (T401774)
$wgOATHSecretKey false
(zavedeno od 1.45) Update to 1.45 (or later) and run the update script before enabling this feature and running its own maintenance script!
A secret key value for encrypting OATH-related data which should be SODIUM_CRYPTO_SECRETBOX_KEYBYTES hexadecimal bytes (64 chars) in length. This variable is currently considered immutable. Do not publicly set this value. There are a few ways to create a cryptographically-secure, random key value, such as the unix command: $ hexdump -vn32 -e'8/8 "%08X" "\n"' /dev/urandom.

Run maintenance/UpdateTOTPSecretsToEncryptedFormat.php after setting this value to encrypt existing database rows.

Note that it is not currently possible to change this value once it is set, and be able to update existing encrypted codes. See T403180 for more information.

OATHAuth also adds a key to the $wgRateLimits array to define rate limits for authentication attempts:

		'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:AccountSecurity (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

Resetting a user token

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:

Verze MediaWiki:
1.40
$ ./maintenance/run OATHAuth:disableOATHAuthForUser <user>
Verze 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';


See also


References

  1. OATH is an acronym for open authentication.
Toto rozšíření se používá na jednom nebo více projektech Wikimedia. Pravděpodobně to znamená, že rozšíření je stabilní a funguje dostatečně dobře, aby jej mohly používat weby s tak vysokou návštěvností. Vyhledejte tento název rozšíření v konfiguračních souborech CommonSettings.php a InitialiseSettings.php Wikimedie, abyste viděli, kde je nainstalováno. Úplný seznam rozšíření nainstalovaných na konkrétní wiki lze vidět na stránce wiki Special:Version.
Toto rozšíření je zahrnuto v následujících wiki farmách/hostitelích a/nebo balíčcích:

AltStyle によって変換されたページ (->オリジナル) /