Jump to content

Erweiterung:OATHAuth

From mediawiki.org
This page is a translated version of the page Extension:OATHAuth and the translation is 29% complete.
Nicht zu verwechseln mit Extension:OAuth.
Diese Erweiterung ist üblicherweise in MediaWiki 1.31 und darüber enthalten. Daher muss sie nicht erneut heruntergeladen werden. Allerdings müssen die folgenden Anweisungen trotzdem beachtet werden.
MediaWiki-Erweiterungen
OATHAuth
Freigabestatus: stabil
Einbindung Benutzerrechte , Spezialseite , Seitenaktivität
Beschreibung Ermöglicht 2-Faktor Authentifizierung um sich Anzumelden
Autor(en) Ryan Lane
Letzte Version Laufende Aktualisierungen
Kompatibilitätspolitik Snapshots werden zusammen mit MediaWiki veröffentlicht. Der Master ist nicht abwärtskompatibel.
MediaWiki >= 1.43
Datenbankänderungen Ja
Tabellen oathauth_users
Lizenz GPL-2.0-or-later AND GPL-3.0-or-later
Herunterladen
  • $wgOATHRequiredForGroups
  • $wgOATHAuthWindowRadius
  • $wgOATHExclusiveRights
  • $wgOATHAuthAccountPrefix
  • $wgOATHAuthDatabase

  • oathauth-enable
  • oathauth-api-all
  • oathauth-disable-for-user
  • oathauth-view-log
  • oathauth-verify-user
Quarterly downloads 87 (Ranked 63rd)
Public wikis using 1,459 (Ranked 205th)
Übersetze die OATHAuth-Erweiterung, wenn sie auf translatewiki.net verfügbar ist
Probleme Offene Aufgaben · Einen Fehler melden

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. Unterstützung von Clients ist für die meisten Mobiltelefone, Smartphones und Desktops verfügbar.

Diese Erweiterung hat nichts mit OAuth zu tun, das ist ein völlig anderes Protokoll.

Verwendung

Die Hilfeseite zur Zwei-Faktor-Authentifizierung bietet Informationen für Endbenutzer wie diese Erweiterung genutzt werden kann. However, the special page will also guide users.

Installation

Warnung Warnung: 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)
  • Die Erweiterung herunterladen und die Datei(en) in ein Verzeichnis namens OATHAuth im Ordner extensions/ ablegen.
    Entwickler und Code-Beitragende sollten stattdessen die Erweiterung von Git installieren, mit:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
  • Wird von git aus installiert, ist Composer auszuführen, um PHP-Abhängigkeiten zu installieren, indem composer install --no-dev im Erweiterungsverzeichnis ausgeführt wird. (Siehe task T173141 für mögliche Komplikationen.)
  • Folgenden Code am Ende deiner LocalSettings.php -Datei einfügen:
    wfLoadExtension( 'OATHAuth' );
    
  • Führe das Aktualisierungsskript aus, welches automatisch die notwendigen Datenbanktabellen erstellt, die diese Erweiterung braucht.
  • Konfiguriere nach Bedarf.
  • 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 Erledigt – Navigiere zu Special:Version in deinem Wiki, um zu überprüfen, ob die Erweiterung erfolgreich installiert wurde.

Konfiguration

Parameter

Configuration Flag Standardwert Beschreibung
$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 (veraltet) 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 false, the value of $wgSecretKey is used.

$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.

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: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.

Verwaltung

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:

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


Siehe auch