How to Setup Two Factor Authentication in Magento 2.4

How to Setup Two Factor Authentication in Magento 2.4

Did you check the latest Magento 2.4 release yet?

Are you excited to implement the new features that can boost the store’s performance and security?

Well, we are!

And as a part of it, here’s the method to set up two factor authentication in Magento 2.4.

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, it is not best practice to disable Magento 2FA.

However, according to Magento 2.4 release notes, 2FA is enabled by default and cannot be disabled.

It is done so to make it harder for the spam users to log in to the admin panel without authority.

Security cannot be neglected when it comes to the online store and hence check the method to configure two-factor authentication in Magento 2.4 store.

Note: While installing the latest Magento 2.4 version, if you face the Unexpected ‘)’  syntax error, check the solution here.

Steps to setup two factor authentication in Magento 2.4:

Magento 2 2FA

  1. Login to admin panel
  2. Navigate to Stores > Configuration
  3. Select 2FA under Security
  4. Expand General section
  5. Select the providers to use. You can also select multiple providers
    1. Google Authenticator
    2. Duo Security
    3. Authy
    4. U2F (Yubikey and others)
  6. Save the configuration

That’s it.

Once configured, the 2FA is prompted as shown below:

Google Authenticator:

Google Auth

Duo Authentication:

Duo Auth

Authy authentication:

Authy

U2F authentication:

How to Setup Two Factor Authentication in Magento 2.4 1

(Image Source – Magento Docs)

You can also refer to the video tutorial to set up two-factor authentication in Magento 2.4 from our Magento 2 video tutorial series:

Secure your Magento 2 admin panel with two-factor authentication using the latest Magento 2 version!

Any doubts about the Magento 2 two factor authentication configuration can be mentioned in the Comments section below. I’d be happy to help you out.

Also, share the solution with the Magento community via social media.

Thank you.

Get Weekly Updates

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

Thank you for subscribing.

Something went wrong.

5
(based on 11 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.

6 comments On How to Setup Two Factor Authentication in Magento 2.4

  • Hi,
    I enabled using this command:
    bin/magento module:enable Magento_TwoFactorAuth
    but when trying to login to the backend, I get the error:
    “The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.”
    But I am sure it is correct.
    Is there another way to configure 2FA without using the backend and keeping my access to the backend?
    Thanks.

  • I am getting this error —

    You need to configure Two-Factor Authorization in order to proceed to your store’s admin area

    An E-mail was sent to you with further instructions

    in my local machine and i am not able to login in admin and not getting any solution tried disable module and other solution available on internet . please suggest

    • Hello Abhishek,
      You need to disable the Magento_TwoFactorAuth extension to resolve the error.
      Thank you.

      • Hi,
        I have the same issue. I did disable the module and was able to enter the Magento backed. But then what to do, 2FA menu has been removed? If it is best practice to enable and configure it, how can I do this without losing my entry to the backend?

Leave a reply:

Your email address will not be published.