swissup / module-tfa

swissup/module-tfa

magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: N/A Security: Pass OSL-3.0

TFA Two Factor Authentication

Two Factor Authentication Extension for Magento 2

2018-05-25 17-16-11

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:

  1. If you've bought the product at Magento's Marketplace - use
    Marketplace installation instructions
  2. Otherwise, you have two options:

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

2018-05-25 17-15-34

  • 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:

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.

Versions
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.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

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.

Static analysis results
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.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 42 42
2.4.8 42 42
2.4.9 42 42

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

Unit tests results by Magento and PHP version
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

Integration tests results by Magento and PHP version
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.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
OSL-3.0

More from swissup

View vendor
Make it pay

Turn 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.