How to Enable or Disable Two-factor Authentication in Magento 2?

Security is always essential for anyone from offline to online. People always think about their security before doing anything. Most importantly, the data can be stolen or hacked in this technological world.  Moreover, when you store your data on the internet it is important to ensure that whatever you are sharing or storing is protected or not. In addition, two-factor authentication(2FA) is a method to verify that the person who is requesting for login is authenticated or not. In this article, we will see how to enable/disable two-factor authentication in Magento 2. 

Luckily, Magento provides two-factor authentication by default in Magento 2.4. Moreover, two-layer authentication is a more effective way to protect the data of the admin. Therefore, it is necessary to know how to enable/disable two-factor authentication in Magento 2. However, you can enable or disable two-factor authentication as per your requirement. First, we will see how to enable two-factor authentication in Magento 2. Further, there is some email software that provides the best services above others such as Sendinblue, GetResponse, etc. 

How to enable two-factor authentication in Magento 2?

Latest Magento 2.4 enables two-factor authentication by default. Check out the following screenshot for a better understanding.

disable two-factor authentication in magento 2 Configure Two-Factor Authorization

First of all, to access your Admin UI, first, you need to enter your “Username” and “Password”. Certainly, in the second screen, you need to enter the authentication code which you will receive via SMS or EMAIL. 

Earlier Magento 2 allows you to install two-factor authentication. Now, let’s check out how to disable two-factor authentication in Magento 2.

How to disable two-factor authentication in Magento 2?

Disable two-factor authentication in Magento 2 using command-line, you can do it using the following two command-line methods.

Method-1

  • Run the command :
bin/magento config:set twofactorauth/general/enable 0
bin/magento cache:flush

Method-2

  • Go to your Magento source code. 
  • Open the app folder -> etc -> config.php.
  • Here, press CTRL+F to find the “Magento_TwoFactorAuth”.
'Magento_TwoFactorAuth' => 0
  • By default, it is 1. [0- disable, 1-enable].
  • After that clean the cache by the following command. 
bin/Magento cache:flush

That’s it. Sounds easy right! 

Hope this will help you in how to enable/disable two-factor authentication in Magento 2. In any case, if you face any problem feel free to contact us. The comment section is all yours, you will surely get the right solution. 

Upgrade your hosting server to nexcess or hostinger. They are the most popular ones and provide the best service above all.

You may also like this: