# Multi-factor authentication

> Multi-factor authentication 是管理工具插件，在现有认证插件之外再加一层多因素认证，也就是常说的双重认证，登录时需再提供一项凭证。安装后在站点管理中启用，并为用户或角色配置可用的认证方式，验证通过后才完成登录，目录记录的分支范围为 1.9 至 5.1。

- 类型：管理工具
- 支持分支：Moodle 1.9–5.1
- 在用站点：442
- 累计下载：222
- 最近更新：2023-08-03
- 维护者：Brendan Heywood
- 类目：Administration tools
- 条目页：https://mudelms.com/plugins/tool_mfa/
- 下载页：https://mudelms.com/download/tool_mfa/
- Markdown：https://mudelms.com/plugins/tool_mfa.md

## 适合

- 登录环节需再核验一项凭证
- 管理员需按角色指定认证方式

## 注意

- 认证方式依赖既有的认证插件

## 原版简介

**NOTE: Moodle 4.3 (and higher) include this feature in the core release - you only need this plugin if you are using an older Moodle release.
 
This is a Moodle plugin which adds Multi-Factor authentication (MFA), also known as Two-factor authentication (2FA) on top of your existing chosen authentication plugins.[https://en.wikipedia.org/wiki/Multi-factor_authentication](https://en.wikipedia.org/wiki/Multi-factor_authentication)
 

 Why another MFA plugin for Moodle? 
There are other 2FA plugins for moodle such as:
 
[https://moodle.org/plugins/auth_a2fa](https://moodle.org/plugins/auth_a2fa)
 
This one is different because it is NOT a Moodle authentication plugin. It leverages new API's that Catalyst specifically implemented in Moodle Core to enable plugins to *augment* the login process instead of replacing it. This means that this MFA plugin can be added on top of any other authentication plugin resulting in a much cleaner architecture, and it means you can compose a solution that does everything you need instead of compromising by swapping out the entire login flow.
 
See this tracker and the dev docs for more info:
 
[https://tracker.moodle.org/browse/MDL-66173](https://tracker.moodle.org/browse/MDL-66173)
 
[https://docs.moodle.org/dev/Login_callbacks](https://docs.moodle.org/dev/Login_callbacks)
 
The other major difference is that we support multiple authentication factor **types** as sub plugins, eg IP Range, Email, TOTP, WebAuthn / FIDO2 and in future others such as SMS or hardware tokens or anything else as new sub-plugins. They can be flexible configured so that different combinations of factors are considered enough.
 Flexible configuration 

 
The MFA has multiple sub-plugins for each type of factor. Different factors can be combined and checked in a specific order. See the plugin readme for the full details:
 
[https://github.com/catalyst/moodle-tool_mfa/#configuration**](https://github.com/catalyst/moodle-tool_mfa/#configuration)
 
For more information, consult the readme:
 
[https://github.com/catalyst/moodle-tool_mfa/](https://github.com/catalyst/moodle-tool_mfa/)
 Warm thanks 
Thanks to [Swissbit](https://www.swissbit.com/en/) for sponsoring the work to add WebAuthn / FIDO2 support to this plugin.

## 数据来源

慕得（MudeLMS）的数据来自 Moodle 官方插件目录与开源项目仓库；核对日期：2026-11-11。慕得®是面向中文用户的、高质量、可信赖的、专业的 Moodle 产品及商业服务站点，提供免费与付费的插件与主题，以及部署、托管、维护和教育系统定制开发。
