扩展:双因素身份验证
![]() 發佈狀態: 穩定版本 |
|
---|---|
![]() |
|
实现 | 用户权限 , 特殊页面 , 页面操作 |
描述 | 为登录提供双因素身份验证 |
作者 | Ryan Lane |
最新版本 | 持续更新 |
兼容性政策 | 快照跟随MediaWiki发布。 master分支不向後兼容。 |
MediaWiki | 1.29+ |
数据库更改 | 是 |
表 | oathauth_users |
许可协议 | GPL-2.0-or-later AND GPL-3.0-or-later |
下載 | |
|
|
|
|
季度下載量 | 117 (Ranked 78th) |
公開的wiki使用 | 1,459 (Ranked 205th) |
翻譯OATHAuth的扩展,若在translatewiki.net可用 | |
問題 | 尚未完成的工作 · 报告錯誤 |
扩展OathAuth提供了双因素身份验证支持。 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. 大多数功能手机,智能手机和台式机都有客户端支持。
用法
双因素身份验证上的帮助页面为最终用户提供了有关如何使用此扩展的信息。 但是,使用的特殊页面也将引导用户。
安裝
- 下载文件,并将其放置在您
extensions/
文件夹中的OATHAuth
目录内。 - 只有從git安裝才运行Composer来安装PHP依赖,通过发行
composer install --no-dev
至扩展目录。 (参见任务T173141了解潜在问题。) - 将下列代码放置在您的
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 setup local cluster caching that can be used by all hosts. Examples include Memcached.
完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。
配置
参数
配置标志 | 默认值 | 描述 |
---|---|---|
$wgOATHAuthWindowRadius
|
4
|
每个方向上应该有效的令牌窗口数。
这告诉OATH接受令牌的有效范围为 |
$wgOATHAuthDatabase
|
false
|
数据库域。 仅用于多数据库环境。 |
$wgOATHAuthSecret
|
false
|
此Wiki的基本OATHAuth密钥,从中派生所有加密密钥。
如果为 |
$wgOATHAuthAccountPrefix
|
false
|
用于OATHAuth用户帐户名称的前缀和用于该帐户的颁发者。
如果为 |
$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 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.
用户权限
- 授予访问权限以启用OATHAuth
应该允许用户访问oathauth-enable
用户权限,以便他们可以以Special:OATHAuth启用它(链接显示为Special:Preferences)。
$wgGroupPermissions['user']['oathauth-enable'] = true;
以上将授予所有注册用户启用OATHAuth的权限。
管理
- 重置用户令牌
如果用户丢失了令牌生成器和恢复令牌,可以通过从oathauth_users
数据库表中删除它们的行来从用户中删除双因素身份验证。
具有shell访问权限的系统管理员可以在命令行cd /path/to/mediawiki/extensions/OATHAuth/maintenance/
上键入然后执行php disableOATHAuthForUser.php "username"
,其中"username"
是禁用2FA以禁用它的用户。
參見
- Wikimedia Security Team/Two-factor Authentication for CentralAuth wikis
- Two-factor authentication (TFA)
- Extension:WebAuthn
- Initiative for Open Authentication (OATH)
![]() | 此扩展用于一个或多个维基媒体项目。 这可能意味着扩展足够稳定、运作足够良好,可以用在这样的高流量的网站上。 请在维基媒体的CommonSettings.php和InitialiseSettings.php配置文件中查找此扩展的名称以查看哪些网站安装了该扩展。 特定wiki上的已安装的扩展的完整列表位于Special:Version页面。 |
![]() | 此擴充功能包含在以下包或/和wiki農場: 這不是一份權威名單。即使一些wiki農場/託管者沒有被列在這裡,他們也可能包含這個extension。請以各wiki農場/託管者或包的狀態為準。 |
- Extensions bundled with MediaWiki 1.31/zh
- Stable extensions/zh
- User rights extensions/zh
- Special page extensions/zh
- Page action extensions/zh
- Extensions with unknown license/zh
- Extensions in Wikimedia version control/zh
- Extensions which add rights/zh
- AuthChangeFormFields extensions/zh
- BeforeCreateEchoEvent extensions/zh
- GetPreferences extensions/zh
- LoadExtensionSchemaUpdates extensions/zh
- UserEffectiveGroups extensions/zh
- UserGetRights extensions/zh
- GetUserPermissionsErrors extensions/zh
- All extensions/zh
- Extensions requiring Composer with git/zh
- Extensions used on Wikimedia/zh
- Extensions included in BlueSpice/zh
- Extensions included in Canasta/zh
- Extensions available as Debian packages/zh
- Extensions included in Miraheze/zh
- Extensions included in MyWikis/zh
- Extensions included in ProWiki/zh
- Extensions included in semantic::core/zh
- Extensions included in wiki.gg/zh
- Extensions included in WikiForge/zh
- Login extensions/zh