vivanwebsolution/mautic-twofactor-auth-bundle
Composer 安装命令:
composer require vivanwebsolution/mautic-twofactor-auth-bundle
包简介
Two-Factor Authentication (2FA) plugin for Mautic 7.
README 文档
README
📘 Overview
The Mautic 7 Two-Factor Authentication Plugin enhances account security by adding a second layer of authentication using Time-based One-Time Passwords (TOTP), such as those generated by Google Authenticator, Authy, or any compatible app.
This plugin allows users to enable, configure, and verify 2FA during login, ensuring enhanced protection against unauthorized access.
⚙️Features
- Google Authenticator–compatible QR code generation
- Time-based One-Time Password (TOTP) verification
- Secure key storage in the database
- Option to enable/disable 2FA per user
- Recovery and reconfiguration support
- Fully compatible with Mautic 7.x
- QR Code generation via Endroid QR Code v6
- TOTP generation and validation via OTPHP v11.3
- Secure per-user secret key storage
🧩Requirements
| Dependency | Version |
|---|---|
| PHP | 8.1 or higher |
| Mautic | ^7.0 |
| endroid/qr-code | ^6.0 |
| spomky-labs/otphp | ^11.3 |
| Composer | Latest |
VivanWebSolution Mautic 7 2FA Plugin
- Clone or copy the plugin into the Mautic
plugins/directory:
cd /path/to/mautic/plugins
git clone https://github.com/niravpateljoin/mautic-twofactor-auth-bundle.git MauticTwoFactorAuthBundle
After installation, make sure to clear the cache and run any necessary migrations:
php bin/console cache:clear php bin/console doctrine:migrations:migrate
Clear cache and reload plugins:
php bin/console mautic:plugins:reload
php bin/console cache:clear
- Go to Settings → Plugins in Mautic and enable Two-Factor Authentication Plugin.
🚀 Installation
Step 1: Require dependencies
Run this command to install the necessary packages:
composer require endroid/qr-code:^6.0 spomky-labs/otphp:^11.3
🔐Configuration
-
Log in to Mautic as an administrator.
-
Navigate to Settings → User Account → Two-Factor Authentication.
-
Click Enable 2FA.
-
A QR code will appear — scan it using Google Authenticator or a compatible TOTP app.
-
Enter the 6-digit code to confirm activation.
-
Once activated, users will be prompted to enter a 2FA code during each login.
Usage
-
Log in to the Sylius Admin panel.
-
Navigate to the Admin User detail page.
-
Use the checkbox in the "Two-Factor Authentication" section to enable or disable Google 2FA for that admin user.
-
When 2FA is enabled, the user will be prompted to enter a Google Authenticator code after logging in with their credentials.
🧰Database Changes
The plugin adds the following columns to the users table:
| Column | Type | Description |
|---|---|---|
twofactor_enabled |
TINYINT(1) | Whether 2FA is active (1) or disabled (0) |
twofactor_secret |
VARCHAR(255) | Stores the user's permanent secret key |
twofactor_temp_secret |
VARCHAR(255) | Stores a temporary secret during setup |
🧭 References
- Mautic 7 Documentation – Official developer documentation for Mautic 7 core and plugin structure.
- Endroid QR Code v6 – Used to generate secure QR codes for 2FA setup within Mautic.
- Spomky-Labs OTPHP v11 – Provides Time-based One-Time Password (TOTP) generation and validation.
- Symfony Framework – The foundation on which Mautic 7 and this plugin are built.
Functionality Screenshot
| Feature | Screenshot |
|---|---|
| Enable 2FA | ![]() |
| Mobile App Example | ![]() |
| QR Code Display | ![]() |
| Verification Prompt | ![]() |
📜 License
This plugin is released under the MIT License .
vivanwebsolution/mautic-twofactor-auth-bundle 适用场景与选型建议
vivanwebsolution/mautic-twofactor-auth-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 11 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 vivanwebsolution/mautic-twofactor-auth-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vivanwebsolution/mautic-twofactor-auth-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-26



