swissup / module-tfa
swissup/module-tfa
TFA Two Factor Authentication
Two Factor Authentication Extension for Magento 2

Server Time
It's extremely important that you keep your server time in sync with some NTP server.
Installation
For clients
There are several ways to install extension for clients:
- If you've bought the product at Magento's Marketplace - use
Marketplace installation instructions - Otherwise, you have two options:
- Install the sources directly from our repository - recommended
- Download archive and use manual installation
For developers
Use this approach if you have access to our private repositories!
Run the following commands:
cd <magento_root>
composer config repositories.swissup composer https://docs.swissuplabs.com/packages/
composer require swissup/tfa --prefer-source --ignore-platform-reqs
bin/magento module:enable Swissup_Core Swissup_Tfa
bin/magento setup:upgrade

- TFA must be enabled by the individual user by clicking 'Account Setting(user)' in the Magento 2 admin panel.
- Once there, the user is able to enable the two factor authentication and view the QR code for a Google Authenticator compatible application.
- Users with TFA enabled will not be able to log into the admin panel without a valid authentication code input on the Magento 2 admin login page.
- Users with TFA disabled can leave the 'Authenticator Code' field blank during login.
Activating the extension
-
Open your admin user account settins at
System > Permisions > All Users > Your User > Tab "Two Factor Authentication" -
Scan QR code with Google Authenticator application using your smartphone.
-
Insert the key you've got on your mobile device into the verification key field.
-
That's all. You've enabled the protection for that admin user. Try logout
and login with verification key. Please notice that key is got refreshed every
30 seconds. In case you have not enabled the protection for some users, the
verification key will be ignored for those users.
Google Authenticator Apps:
To use the two factor authentication, your user will have to install a Google Authenticator compatible app, those are some of the currently available:
- Authy for iOS, Android, Chrome, OS X
- FreeOTP for iOS, Android and Pebble
- Google Authenticator for iOS
- Google Authenticator for Android
- Google Authenticator (port) on Windows Store
- Microsoft Authenticator for Windows Phone
- LastPass Authenticator for iOS, Android, OS X, Windows
- 1Password for iOS, Android, OS X, Windows
Console Commands
TFA can be disabled using console commands if needed:
List TFA status For All Admin Users
php bin/magento swissup:tfa:list
Disable TFA For Single Admin User (by email)
php bin/magento swissup:tfa:disable [email protected]
No changelog yet
The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 0.2.8 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2026-05-15 11:22:06 |
| 0.2.7 | stable | Not tested | Not yet tested Details | 2025-04-11 13:25:19 |
| 0.2.6 | stable | Not tested | Not yet tested Details | 2022-09-13 11:54:38 |
| 0.2.5 | stable | Not tested | Not yet tested Details | 2022-08-23 07:12:38 |
| 0.2.4 | stable | Not tested | Not yet tested Details | 2022-08-15 11:54:53 |
| 0.2.3 | stable | Not tested | Not yet tested Details | 2022-08-12 12:09:04 |
| 0.2.2 | stable | Not tested | Not yet tested Details | 2020-07-30 08:26:00 |
| 0.2.1 | stable | Not tested | Not yet tested Details | 2019-11-15 08:41:13 |
| 0.2.0 | stable | Not tested | Not yet tested Details | 2018-09-26 12:16:01 |
| 0.1.1 | stable | Not tested | Not yet tested Details | 2018-06-21 11:15:27 |
| 0.1.0 | stable | Not tested | Not yet tested Details | 2018-05-25 14:27:22 |
Requires 3
| Package | Constraint |
|---|---|
| swissup/module-core | ^1.12.27 |
| pragmarx/google2fa-qrcode | ^3.0 |
| bacon/bacon-qr-code | ^1.0.0|^2.0.0|^3.0.0 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 17 | 17 warnings (ruleset: Magento2) — 4 auto-fixable with phpcbf |
| PHPMD | Warning | 5 | 5 rule violations (MissingImport:3, UnusedFormalParameter:1, UnusedLocalVariable:1) |
| Cpd | Pass | 0 | |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Integration tests
| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | ||
| 2.4.8 | N/A | N/A | ||
| 2.4.9 | N/A | N/A |
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from swissup
View vendorTurn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.