plugin-icon

Two-Factor

作者:WordPress.org·
Enable Two-Factor Authentication (2FA) using time-based one-time passwords (TOTP), Universal 2nd Factor (U2F), email, and backup verification codes.
评级
4.8/5
版本
0.14.2
活跃安装
90K
最后更新
Dec 11, 2025
Two-Factor

通过“用户”“个人资料”下的“双重身份验证选项”部分,为您的账户启用和配置一个或多个双重身份验证方式:

  • 邮件验证码
  • 基于时间的一次性密码(TOTP)
  • FIDO 通用第二因素(U2F)
  • 备用验证码
  • 虚拟方式(仅用于测试目的)

有关更多历史,请参阅这篇文章

动作和过滤器

以下列出该插件提供的动作和过滤器钩子:

  • two_factor_providers 过滤器:将覆盖可用的双重身份验证提供方式,例如电子邮件和基于时间的一次性密码。数组值为双重身份验证方式的 PHP 类名。
  • two_factor_providers_for_user filter overrides the available two-factor providers for a specific user. Array values are instances of provider classes and the user object WP_User is available as the second argument.
  • two_factor_enabled_providers_for_user 过滤器:将覆盖提供给用户启用的双重身份验证方式清单。第一个参数为启用的方式提供类名数组作为值,第二个参数为用户 ID。
  • two_factor_user_authenticated 动作:接收已登录的 WP_User 对象作为第一个参数,用在身份验证工作流之后确定登录的用户。
  • two_factor_user_api_login_enable filter restricts authentication for REST API and XML-RPC to application passwords only. Provides the user ID as the second argument.
  • two_factor_email_token_ttl filter overrides the time interval in seconds that an email token is considered after generation. Accepts the time in seconds as the first argument and the ID of the WP_User object being authenticated.
  • two_factor_email_token_length filter overrides the default 8 character count for email tokens.
  • two_factor_backup_code_length filter overrides the default 8 character count for backup codes. Provides the WP_User of the associated user as the second argument.
  • two_factor_rest_api_can_edit_user filter overrides whether a user’s Two-Factor settings can be edited via the REST API. First argument is the current $can_edit boolean, the second argument is the user ID.
免费使用Business套餐
通过安装,您同意 WordPress.com 服务条款第三方插件条款
目前已测试版本
WordPress 6.9
这个插件是可用的下载,适用于您的站点。