How to Disable Magento 2 Two Factor Authentication

How to Disable Magento 2 Two Factor Authentication

The latest release, Magento 2.4 enables two-factor authentication by default.

Earlier, Magento 2 did offer an option to install two-factor authentication. The store owner can enable or disable the Magento 2 2FA as per the requirements.

However, if you have downloaded the latest Magento 2 version and installed it, you might have noticed that the two-factor authentication cannot be disabled.

Though it is not recommended to disable 2FA in Magento 2 for security purpose, you may want to still do it for multiple reasons:

  • Testing environment
  • The store is in the development stage

There is no option to disable Magento 2 two factor authentication in Magento 2.4 and hence Mark Shust, a certified Magento developer from Cleveland, Ohio has developed a module to disable Magento 2 two factor authentication.

His module adds the toggle to enable and disable 2FA from the Magento 2 admin panel.

When you install this module, 2FA is enabled by default in order to prevent any side effects or security loopholes from being introduced during automated installation processes.

To disable it, the admin has to navigate to Stores > Configuration. Under Security, selecting 2FA, expand General section and set “Enable 2FA” to No.

Method to disable Magento 2 two factor authentication:

Create config.xml

Create di.xml

Create module.xml

Create system.xml

Create BypassTwoFactorAuth.php

Create registration.php:

Create composer.json:

That’s it.

You can also enable or disable 2FA from the command line using the below command:

Any doubts in the method to disable two-factor authentication in Magento 2.4 can be mentioned in the Comments section below. I’d be happy to help.

Also, do share the post with the Magento Community via social media.

Thank you.

Related Post – [Solved] Syntax Error – Unexpected ‘)’ While Installing Magento 2.4


Get Weekly Updates

Never miss Magento tips, tricks, tutorials, and news.

Thank you for subscribing.

Something went wrong.

(based on 16 Reviews)

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. Owing to his contributions in Magento Forums and posting solutions, he is among the top 50 contributors of the Magento community in 2019. When he is not engrossed with anything related to Magento, he loves to play cricket.

Leave a reply:

Your email address will not be published.