PHPackages                             warleyelias/magento2-module-disabletwofactorauth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. warleyelias/magento2-module-disabletwofactorauth

ActiveMagento2-module[Authentication &amp; Authorization](/categories/authentication)

warleyelias/magento2-module-disabletwofactorauth
================================================

The DisableTwoFactorAuth module provides the ability to disable two-factor authentication.

2.0.3(10mo ago)019MITPHPPHP ^7||^8

Since Jul 8Pushed 10mo agoCompare

[ Source](https://github.com/warleyelias/magento2-module-disabletwofactorauth)[ Packagist](https://packagist.org/packages/warleyelias/magento2-module-disabletwofactorauth)[ GitHub Sponsors](https://github.com/markshust)[ RSS](/packages/warleyelias-magento2-module-disabletwofactorauth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

MarkShust\_DisableTwoFactorAuth
===============================

[](#markshust_disabletwofactorauth)

Provides the ability to disable two-factor authentication.

 [![Supported Magento Versions](https://camo.githubusercontent.com/34d9c15b8dbd5000c17b5b19b67d54788d2f404e5bc765857178435524a54bc3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6167656e746f2d322e342e30254532253830253933322e342e372b2d627269676874677265656e2e7376673f6c6f676f3d6d6167656e746f266c6f6e6743616368653d74727565267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/34d9c15b8dbd5000c17b5b19b67d54788d2f404e5bc765857178435524a54bc3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6167656e746f2d322e342e30254532253830253933322e342e372b2d627269676874677265656e2e7376673f6c6f676f3d6d6167656e746f266c6f6e6743616368653d74727565267374796c653d666c61742d737175617265) [![Latest Stable Version](https://camo.githubusercontent.com/c797e2cddb5c1f2100858db8b336033f29dcc8cdfc6de19f9fcbf55df2460d6d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61726b73687573742f6d6167656e746f322d6d6f64756c652d64697361626c6574776f666163746f72617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/markshust/magento2-module-disabletwofactorauth) [![Composer Downloads](https://camo.githubusercontent.com/e7233fe31deb3c714cf18d1c18acea2020b5ea2f64be49d217947cca93b028e9/68747470733a2f2f706f7365722e707567782e6f72672f6d61726b73687573742f6d6167656e746f322d6d6f64756c652d64697361626c6574776f666163746f72617574682f646f776e6c6f616473)](https://packagist.org/packages/markshust/magento2-module-disabletwofactorauth) [![Maintained - Yes](https://camo.githubusercontent.com/04aba48520e6322ebc6c41b7995626a88ce408bd46ec4eb15ae474936b345276/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e7461696e65642533462d7965732d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity) [![](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://opensource.org/licenses/MIT)

Table of contents
-----------------

[](#table-of-contents)

- [Summary](#summary)
- [Why](#why)
- [Installation](#installation)
- [Usage](#usage)
- [Credits](#credits)
- [License](#license)

Summary
-------

[](#summary)

With the release of Magento 2.4, two-factor authentication (also known as 2FA) became enabled by default, with no ability to disable it in either the admin or console. However, there are situations which may require 2FA to be disabled or temporarily turned off, such as within development or testing environments.

This module automatically disables 2FA while in developer mode (since version 2.0.0), and adds the missing toggle to turn 2FA on or off from the admin for other environments. It does this by hooking into the core code in a very seamless manner, just as would be done if this toggle existed in the core code. Installing this module should not open any security holes, as it just works off of a simple config toggle which, if not present, falls back to the default functionality.

You can also toggle 2FA back on while in developer mode, if you need to test your code functionality while 2FA is enabled.

[![Demo](https://raw.githubusercontent.com/markshust/magento2-module-disabletwofactorauth/master/docs/demo-2021-11-10.png)](https://raw.githubusercontent.com/markshust/magento2-module-disabletwofactorauth/master/docs/demo-2021-11-10.png)

Why
---

[](#why)

Why should you use this module? I hear all of the time that you can just disable Magento's 2FA module. There is a large inherent issue with doing this though.

When you disable a module, it updates the `app/etc/config.php` file with the removed module, which will eventually make its way upstream (accidentally committed to version control or unintendedly leaving your development environment). This will disable 2FA on staging/production, which is a big security concern. This module resolves this because you can keep it installed &amp; enabled on dev/stage/prod, but control whether or not 2FA is enabled or disabled with configuration settings or environment variables. This means you can have it permanently disabled on dev, but have it permanently enabled in all other environments, all while keeping this module installed in all environments.

Installation
------------

[](#installation)

```
composer require --dev markshust/magento2-module-disabletwofactorauth
bin/magento module:enable MarkShust_DisableTwoFactorAuth
bin/magento setup:upgrade

```

Usage
-----

[](#usage)

This module automatically disables 2FA in developer mode (since version 2.0.0). In any other deployment mode, 2FA is kept enabled by default. This is to prevent any unexpected side effects or security loopholes from being introduced during automated installation processes.

It is highly recommended to install this module as a dev dependency to avoid security warning reports from either Adobe Commerce or other production environments which run security checks. This can be done either by passing in the `--dev` flag when installing it with Composer, or by adding it to the `require-dev` property of your `composer.json` file.

### Disable 2FA

[](#disable-2fa)

It may still be desirable to disable 2FA in non-production environments, such as within testing or internal staging environments. For these cases, 2FA is not automatically disabled. However, there are toggles to override the default Magento settings to disable 2FA within these environments.

You can also bypass 2FA for API token generation. This can be useful for third-party vendors during module development.

*NOTE: Always keep 2FA enabled within production environments for security purposes.*

#### 2FA

[](#2fa)

To disable 2FA, visit **Admin &gt; Stores &gt; Settings &gt; Configuration &gt; Security &gt; 2FA** and set *Enable 2FA* to **No**.

CLI: `bin/magento config:set twofactorauth/general/enable 0`

#### 2FA for API Token Generation

[](#2fa-for-api-token-generation)

To disable 2FA for API Token Generation, visit **Admin &gt; Stores &gt; Settings &gt; Configuration &gt; Security &gt; 2FA** and set *Enable 2FA for API Token Generation* to **No**.

CLI: `bin/magento config:set twofactorauth/general/enable_for_api_token_generation 0`

### Enable 2FA in developer mode

[](#enable-2fa-in-developer-mode)

This module automatically disables 2FA while developer mode is enabled, but there may be situations when you need 2FA enabled during development. Rather than needing to disable this module, you can just disable this configuration setting in the admin.

To enable 2FA while in developer mode, visit **Admin &gt; Stores &gt; Settings &gt; Configuration &gt; Security &gt; 2FA** and set *Disable 2FA in Developer Mode* to **No**.

CLI: `bin/magento config:set twofactorauth/general/disable_in_developer_mode 0`

Credits
-------

[](#credits)

### M.academy

[](#macademy)

This module is sponsored by [M.academy](https://m.academy/), the simplest way to master Magento development.

[![M.academy](docs/macademy-logo-200x60.png)](https://m.academy/)

### Mark Shust

[](#mark-shust)

My name is Mark Shust and I am a 6X Adobe Commerce Certified Developer and the founder of [M.academy](https://m.academy). Since the early days of Magento, I've been involved with many intricately complex eCommerce and open-source projects.

My passion is teaching and helping others learn Magento, and has created many courses and tutorials to help thousands of students from all over the world to learn and improve their Magento skills.

- [🖥️ Learn with Magento courses](https://m.academy/courses/)
- [📖 Read my technical articles](https://m.academy/articles/)
- [🔗 Connect on LinkedIn](https://www.linkedin.com/in/MarkShust/)
- [🎥 Watch on YouTube](https://youtube.com/markshust)
- [🐦 Follow me on X](https://twitter.com/MarkShust)
- [💌 Contact me](https://m.academy/contact/)

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance54

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 71.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

308d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5356619?v=4)[Warley Elias](/maintainers/warleyelias)[@warleyelias](https://github.com/warleyelias)

---

Top Contributors

[![markshust](https://avatars.githubusercontent.com/u/437029?v=4)](https://github.com/markshust "markshust (28 commits)")[![jbrada](https://avatars.githubusercontent.com/u/7402947?v=4)](https://github.com/jbrada "jbrada (4 commits)")[![warleyelias](https://avatars.githubusercontent.com/u/5356619?v=4)](https://github.com/warleyelias "warleyelias (2 commits)")[![drpayyne](https://avatars.githubusercontent.com/u/22623301?v=4)](https://github.com/drpayyne "drpayyne (2 commits)")[![makao](https://avatars.githubusercontent.com/u/690371?v=4)](https://github.com/makao "makao (1 commits)")[![Jitheesh](https://avatars.githubusercontent.com/u/1536507?v=4)](https://github.com/Jitheesh "Jitheesh (1 commits)")[![sprankhub](https://avatars.githubusercontent.com/u/930199?v=4)](https://github.com/sprankhub "sprankhub (1 commits)")

---

Tags

devAuthenticationmagento2fatwo-factormagento2

### Embed Badge

![Health badge](/badges/warleyelias-magento2-module-disabletwofactorauth/health.svg)

```
[![Health](https://phpackages.com/badges/warleyelias-magento2-module-disabletwofactorauth/health.svg)](https://phpackages.com/packages/warleyelias-magento2-module-disabletwofactorauth)
```

###  Alternatives

[markshust/magento2-module-disabletwofactorauth

The DisableTwoFactorAuth module provides the ability to disable two-factor authentication.

2282.7M6](/packages/markshust-magento2-module-disabletwofactorauth)[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

339785.3k8](/packages/laragear-two-factor)[scheb/2fa-bundle

A generic interface to implement two-factor authentication in Symfony applications

6914.0M62](/packages/scheb-2fa-bundle)[scheb/2fa-google-authenticator

Extends scheb/2fa-bundle with two-factor authentication using Google Authenticator

298.2M30](/packages/scheb-2fa-google-authenticator)[scheb/2fa-trusted-device

Extends scheb/2fa-bundle with trusted devices support

355.1M16](/packages/scheb-2fa-trusted-device)[scheb/2fa-email

Extends scheb/2fa-bundle with two-factor authentication via email

354.3M16](/packages/scheb-2fa-email)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
