I'm trying to install Magento 2.4 Version on my Local System and getting a Two Factor Authentication option when I log in with admin page credentials.

Steps Taken by me to solve this issue - I try to bypass this Admin page Authentication Step by following this link, But not find the required information to solve the same. - Officals Docs

Two Factor Login Option at Admin Page

  • please verify if you are able to send mails with php. I suggest to use mailhog or any other mailcatcher for local development. Aug 5, 2020 at 14:51
  • Pratik Oza's answer helped me to resolve the problem, I used option 2 as a quick workaround. Maybe you could accept his answer: stackoverflow.com/help/someone-answers
    – Kai Mechel
    Oct 26, 2020 at 10:33

2 Answers 2


Option 1:

Please configure SMTP in your local system to send/receive email notification and after setup 2FA.

SMTP Extension for Magento 2

Option 2:

Temporary workaround to setup 2FA without having SMTP:

  1. navigate to /admin and log in
  2. you should see the 2FA screen now
  3. add var_dump($url);die; on line 86 (function sendConfigRequired) in vendor/magento/module-two-factor-auth/Model/EmailUserNotifier.php
  4. refresh /admin
  5. copy the URL that is displayed
  6. remove the var_dump
  7. use the URL copied earlier to navigate to the 2FA setup

Option 3:

Temporary disable TwoFactorAuth module using following command(for dev environment):

php bin/magento module:disable Magento_TwoFactorAuth
php bin/magento cache:flush

Option 4:

Install the following module to enable/disable two-factor authentication from backend:



For quick access, I recommend disabling the Magento TwoFactorAuth

bin/magento module:disable Magento_TwoFactorAuth

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.