Extension:OATHAuth/ja

混同しないでください: Extension:OAuth.
この拡張機能は MediaWiki 1.31 以降に同梱されているため、ダウンロードする必要はありません。 残りの設定手順は必ず従ってください。
Category:Extensions bundled with MediaWiki 1.31/ja Category:Extensions with unknown license/ja
MediaWiki 拡張機能マニュアル
OATHAuth
リリースの状態: 安定Category:Stable extensions/ja
実装 利用者権限 Category:User rights extensions/ja, 特別ページ Category:Special page extensions/ja, ページの操作 Category:Page action extensions/ja
説明 ログインする際の二要素認証を可能にします。
作者 Ryan Lane
最新バージョン 継続的な更新
互換性の方針 MediaWiki とともにリリースされるスナップショット。 master には後方互換性がありません。
データベースの変更 はい
テーブル oathauth_types
oathauth_devices
oathauth_users
ライセンス GPL-2.0-or-later AND GPL-3.0-or-later
ダウンロード Category:Extensions in Wikimedia version control/ja
  • $wgOATHAuthWindowRadius
  • $wgOATHRequiredForGroups
  • $wgOATHAuthAccountPrefix
  • $wgOATHExclusiveRights
translatewiki.net で翻訳を利用できる場合は、OATHAuth 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告
Category:All extensions/ja

OATHAuth[1]拡張機能で、二要素認証に対応。 既定では、これにはtime-based one-time password (TOTP) の実装が含まれており、利用者は携帯電話やデスクトップアプリケーションから2FAコードを生成できるようになっています。 クライアントサポートは、ほとんどのフィーチャーフォン、スマートフォン、デスクトップで利用可能です。

この拡張機能はOAuthとは別のものです。OAuthとは何の関係もありません。

使用法

Two-factor authentication上のヘルプページは利用者のためにこの拡張機能の使い方に関する情報を提供します。 ただし、特別ページでは利用者にも案内しています。

インストール

警告 警告: 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)
  • ダウンロードして、ファイルをextensions/フォルダー内のOATHAuthという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
    
  • Gitでのインストールの場合のみ、PHPの依存関係をインストールするためComposerを実行します。 (合併症の可能性についてはT173141を参照。)Category:Extensions requiring Composer with git/ja
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'OATHAuth' );
    
  • 更新スクリプトを実行します。このスクリプトは、この拡張機能が必要とするデータベーステーブルを自動的に作成します。
  • 必要に応じて設定します。
  • 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 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

設定の構成

パラメーター

構成フラグ 既定値 説明
$wgOATHAuthWindowRadius 4 有効であるべき各方向のトークン・ウィンドウの数。

実質的に((1 + 2 * $wgOATHAuthWindowRadius) * 30)秒の範囲でトークンを受け入れるよう、OATHに指示します。 有効なウィンドウの範囲は、現在時刻を中心にしています。 この変数は、利用者の時間とサーバーの時間の違いを考慮することを目的としています。 ただし、できるだけ少なくすることをおすすめします。

$wgOATHAuthDatabase false (廃止予定) データベースのドメイン。 複数のデータベースでのみ使用されます。 After MediaWiki 1.42, you should use $wgVirtualDomainsMapping['virtual-oathauth'] instead of this option.
$wgOATHAuthSecret false 全暗号化キーの派生元であるこのWikiの基本OATHAuthシークレット。

falseの場合、$wgSecretKeyを使用します。

$wgOATHAuthAccountPrefix false OATHAuthのアカウント名に使用される接頭辞と、アカウントに適用される発行者。

falseの場合、$wgSitenameを使用します。

$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 ],
		]

user-globalキーはバージョン1.35からでしか使えないことに注意してください。 Earlier version have to rely on user and perhaps ip-all. 完全な一覧は、$wgRateLimits の説明文書を参照してください。

利用者権限

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;

上記から、全登録利用者にOATHAuthを有効にするためのアクセス権限が付与されます。

管理

利用者トークンのリセット

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

  1. OATH は open authentication の頭字語です。
Category:Extensions used on Wikimedia/ja#OATHAuth/ja Category:Login extensions/ja
Category:All extensions/ja Category:AuthChangeFormFields extensions/ja Category:Extensions available as Debian packages/ja Category:Extensions bundled with MediaWiki 1.31/ja Category:Extensions in Wikimedia version control/ja Category:Extensions included in BlueSpice/ja Category:Extensions included in Canasta/ja Category:Extensions included in Miraheze/ja Category:Extensions included in MyWikis/ja Category:Extensions included in ProWiki/ja Category:Extensions included in WikiForge/ja Category:Extensions included in semantic::core/ja Category:Extensions included in wiki.gg/ja Category:Extensions requiring Composer with git/ja Category:Extensions used on Wikimedia/ja Category:Extensions which add rights/ja Category:Extensions with unknown license/ja Category:GetPreferences extensions/ja Category:GetUserPermissionsErrors extensions/ja Category:LoadExtensionSchemaUpdates extensions/ja Category:Login extensions/ja Category:Page action extensions/ja Category:Special page extensions/ja Category:Stable extensions/ja Category:UnitTestsAfterDatabaseSetup extensions/ja Category:UnitTestsBeforeDatabaseTeardown extensions/ja Category:UserEffectiveGroups extensions/ja Category:UserGetRights extensions/ja Category:User rights extensions/ja