PHPackages                             vivanwebsolution/mautic-twofactor-auth-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. vivanwebsolution/mautic-twofactor-auth-bundle

ActiveMautic-plugin[Authentication &amp; Authorization](/categories/authentication)

vivanwebsolution/mautic-twofactor-auth-bundle
=============================================

Two-Factor Authentication (2FA) plugin for Mautic 7.

05PHP

Since Nov 26Pushed 5mo agoCompare

[ Source](https://github.com/niravpateljoin/mautic-twofactor-auth-bundle)[ Packagist](https://packagist.org/packages/vivanwebsolution/mautic-twofactor-auth-bundle)[ RSS](/packages/vivanwebsolution-mautic-twofactor-auth-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Mautic 7 Two-Factor Authentication (2FA) Plugin
===============================================

[](#mautic-7-two-factor-authentication-2fa-plugin)

📘 Overview
----------

[](#-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
----------

[](#️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
-------------

[](#requirements)

DependencyVersionPHP8.1 or higherMautic^7.0endroid/qr-code^6.0spomky-labs/otphp^11.3ComposerLatest---

VivanWebSolution Mautic 7 2FA Plugin
====================================

[](#vivanwebsolution-mautic-7-2fa-plugin)

1. **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

```

2. Go to **Settings → Plugins** in Mautic and enable Two-Factor Authentication Plugin.

🚀 Installation
--------------

[](#-installation)

### Step 1: Require dependencies

[](#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
--------------

[](#configuration)

1. Log in to Mautic as an administrator.
2. Navigate to **Settings → User Account → Two-Factor Authentication**.
3. Click **Enable 2FA**.
4. A QR code will appear — scan it using **Google Authenticator** or a compatible TOTP app.
5. Enter the 6-digit code to confirm activation.
6. Once activated, users will be prompted to enter a 2FA code during each login.

Usage
-----

[](#usage)

1. **Log in** to the Sylius Admin panel.
2. Navigate to the **Admin User detail page**.
3. Use the **checkbox** in the "Two-Factor Authentication" section to enable or disable Google 2FA for that admin user.
4. When 2FA is enabled, the user will be prompted to enter a **Google Authenticator code** after logging in with their credentials.

🧰Database Changes
-----------------

[](#database-changes)

The plugin adds the following columns to the users table:

ColumnTypeDescription`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
------------

[](#-references)

- [Mautic 7 Documentation](https://developer.mautic.org/) – Official developer documentation for Mautic 7 core and plugin structure.
- [Endroid QR Code v6](https://github.com/endroid/qr-code) – Used to generate secure QR codes for 2FA setup within Mautic.
- [Spomky-Labs OTPHP v11](https://github.com/spomky-labs/otphp) – Provides Time-based One-Time Password (TOTP) generation and validation.
- [Symfony Framework](https://symfony.com/doc/current/index.html) – The foundation on which Mautic 7 and this plugin are built.

Functionality Screenshot
------------------------

[](#functionality-screenshot)

FeatureScreenshotEnable 2FA[![Enable 2FA](docs/functionality/enable.png)](docs/functionality/enable.png)Mobile App Example[![App Example](docs/functionality/app.png)](docs/functionality/app.png)QR Code Display[![QR Code](docs/functionality/qr.png)](docs/functionality/qr.png)Verification Prompt[![Verify Page](docs/functionality/verifycode.png)](docs/functionality/verifycode.png)📜 License
---------

[](#-license)

This plugin is released under the MIT License .

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance48

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/94c17dbc99e31e28bd7d2ca81a420598cc29f6e5974cebe6c0cf5cc53bfd3042?d=identicon)[vivanwebsolution](/maintainers/vivanwebsolution)

---

Top Contributors

[![niravpateljoin](https://avatars.githubusercontent.com/u/27916009?v=4)](https://github.com/niravpateljoin "niravpateljoin (2 commits)")

### Embed Badge

![Health badge](/badges/vivanwebsolution-mautic-twofactor-auth-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/vivanwebsolution-mautic-twofactor-auth-bundle/health.svg)](https://phpackages.com/packages/vivanwebsolution-mautic-twofactor-auth-bundle)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
