Magento Two-Factor Authentication (2FA) improves security by requiring two-step authentication to access the Magento Admin UI from all devices. The extension supports multiple authenticators including Google Authenticator, Authy, Duo, and U2F keys. It applies to Magento Admin UI users only; it does not apply to storefront customer accounts.
Two-Factor Authentication gives you the ability to:
- Enable authenticator support for the Admin.
- Manage and configure authenticator settings globally or per user account.
- Reset authenticators and manage trusted devices for users.
At this time, Two-Factor Authentication can be installed only from the command line.
Install the extension using the following Composer command:
composer require msp/twofactorauth:3.0.0
To complete installation in an existing Magento instance, run the following commands to enable the module:
bin/magento module:enable --all
Configure and manage 2FA
Administrators have options to:
- Review existing authenticators configured per user account
- Require specific authenticators
- Reset or remove authenticators to resolve access issues
- Revoke access for devices to resolve access issues
After enabling and configuring 2FA for your Magento instance, Magento Admin users need to install and configure an authenticator. For complete instructions, see Using Two-Factor Authentication.
|Google Authenticator||Generate and enter code from mobile app Requirements: Enable in Admin|
|Authy||SMS, call, token, and one touch
Requirements: Enable in Admin and API keys
|U2F Keys||Physical device to authenticate, like YubiKey.
Requirements: Enable in Admin
|Duo Security||SMS and push notification.
Requirements: Enable in Admin, Integration and Secret keys, API hostname
The extension supports command line options for disabling, revoking, and resetting authenticators. Use these commands when you cannot access the Magento Admin UI.
If you have issues with 2FA, you can disable 2FA globally for the Magento instance.
Reset authenticator per account
If you need to manually reset a single user configuration, enter the following command. It restarts configuration and 2FA subscription for the user account.
bin/magento msp:security:tfa:reset <username> <provider>
Advanced emergency steps
These advanced steps require a full understanding of database management and modifications. We advise caution when making any changes directly to your database.
In your database, you can modify the following tables and values to affect and override 2FA.
msp/twofactorauth/enabled- Set to zero to disable 2FA globally.
msp/twofactorauth/force_providers- Delete this entry to remove forced providers option.
- Delete one user row to reset the user’s 2FA preference and configuration.