PHPackages                             scheb/2fa - 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. scheb/2fa

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

scheb/2fa
=========

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

v8.5.0(1mo ago)578630.7k—3.3%77[5 issues](https://github.com/scheb/2fa/issues)1MITPHPPHP ~8.4.0 || ~8.5.0

Since Jun 4Pushed 1mo ago10 watchersCompare

[ Source](https://github.com/scheb/2fa)[ Packagist](https://packagist.org/packages/scheb/2fa)[ Docs](https://github.com/scheb/2fa)[ RSS](/packages/scheb-2fa/feed)WikiDiscussions 8.x Synced 1mo ago

READMEChangelog (10)Dependencies (46)Versions (76)Used By (1)

scheb/2fa
=========

[](#scheb2fa)

This bundle provides **[two-factor authentication](https://en.wikipedia.org/wiki/Multi-factor_authentication) for your [Symfony](https://symfony.com/) application**.

[![Build Status](https://github.com/scheb/2fa/actions/workflows/ci.yaml/badge.svg?branch=8.x)](https://github.com/scheb/2fa/actions?query=workflow%3ACI+branch%3A8.x)[![Code Coverage](https://camo.githubusercontent.com/a0286a5e622260ef4c8533d20510d6bb679d8f7321c0903a6c06e81c1057db56/68747470733a2f2f636f6465636f762e696f2f67682f73636865622f3266612f6272616e63682f382e782f67726170682f62616467652e737667)](https://app.codecov.io/gh/scheb/2fa/branch/8.x)[![Latest Stable Version](https://camo.githubusercontent.com/c711a5e44a1d87f4b2e542b8c62a221b57d072d665d880ee1369b90051b710a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73636865622f3266612d62756e646c65)](https://packagist.org/packages/scheb/2fa-bundle)[![Monthly Downloads](https://camo.githubusercontent.com/25a90316437740fa7a35f2a7fe83ba98ece5d7287304fc31124501d7e390256d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f73636865622f3266612d62756e646c65)](https://packagist.org/packages/scheb/2fa-bundle/stats)[![Total Downloads](https://camo.githubusercontent.com/c9a7146425444b6d85fd6105d6812e09441ac34b3a82d67c79a2f42ffe46315a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73636865622f3266612d62756e646c65)](https://packagist.org/packages/scheb/2fa-bundle/stats)[![License](https://camo.githubusercontent.com/2449960dfb471db31c929de424a1e9dc4c62abea56062f235b415aea8acaa5e8/68747470733a2f2f706f7365722e707567782e6f72672f73636865622f3266612f6c6963656e73652e737667)](https://packagist.org/packages/scheb/2fa)

[![SchebTwoFactorBundle Logo](doc/2fa-logo.svg)](doc/2fa-logo.svg)

ℹ️ The repository contains bundle versions ≥ 5, which are compatible with Symfony 4.4 or later. The older (unsupported) versions are located in the [scheb/two-factor-bundle](https://github.com/scheb/two-factor-bundle) repository.

---

The bundle is split into sub-packages, so you can choose the exact feature set you need and keep installed dependencies to a minimum.

Core features are provided by `scheb/2fa-bundle`:

- Interface for custom two-factor authentication methods
- Trusted IPs
- Multi-factor authentication (more than 2 steps)
- CSRF protection
- Brute-force protection
- Authentication code reuse protection
- Whitelisted routes (accessible during two-factor authentication)
- Fully customizable conditions when to perform two-factor authentication

Additional features:

- Trusted devices (once passed, no more two-factor authentication on that device) (`scheb/2fa-trusted-device`)
- Single-use backup codes for when you don't have access to the second factor device (`scheb/2fa-backup-code`)
- QR codes to scan with your mobile device

Two-factor authentication methods:

- [TOTP authentication](https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm) (`scheb/2fa-totp`)
- [Google Authenticator](https://en.wikipedia.org/wiki/Google_Authenticator) (`scheb/2fa-google-authenticator`)
- Authentication code via email (`scheb/2fa-email`)

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

[](#installation)

Follow the [installation instructions](https://symfony.com/bundles/SchebTwoFactorBundle/8.x/installation.html).

Documentation
-------------

[](#documentation)

Detailed documentation of all features can be found on the [Symfony Bundles Documentation](https://symfony.com/bundles/SchebTwoFactorBundle/8.x/index.html) website.

Demo
----

[](#demo)

This repository contains a small test application that can be quickly set-up locally to test two-factor authentication in a real Symfony environment. Check out the readme file in the [`app` folder](app/README.md) for more details.

For a live demo of this application, visit .

Version Guidance
----------------

[](#version-guidance)

VersionStatusSymfony Version[1.x](https://github.com/scheb/two-factor-bundle/tree/1.x)EOL&gt;= 2.1, &lt; 2.7[2.x](https://github.com/scheb/two-factor-bundle/tree/2.x)EOL^2.6, ^3.0, ^4.0[3.x](https://github.com/scheb/two-factor-bundle/tree/3.x)EOL3.4, ^4.0, ^5.0[4.x](https://github.com/scheb/two-factor-bundle/tree/4.x)EOL3.4, ^4.0, ^5.0[5.x](https://github.com/scheb/2fa/tree/5.x)EOL4.4, ^5.0[6.x](https://github.com/scheb/2fa/tree/6.x)EOL5.4, ^6.0[7.x](https://github.com/scheb/2fa/tree/7.x)Bug &amp; security fixes6.4, ^7.0**[8.x](https://github.com/scheb/2fa/tree/8.x)**New features + Bug fixes7.4, ^8.0License
-------

[](#license)

This software is available under the [MIT license](LICENSE).

Security
--------

[](#security)

For information about the security policy and know security issues, see [SECURITY.md](SECURITY.md).

Contributing
------------

[](#contributing)

Want to contribute to this project? See [CONTRIBUTING.md](CONTRIBUTING.md).

Support Me
----------

[](#support-me)

I'm developing this library since 2014. I love to hear from people using it, giving me the motivation to keep working on my open source projects.

If you want to let me know you're finding it useful, please consider giving it a star ⭐ on GitHub.

If you love my work and want to say thank you, you can help me out for a beer 🍻️ [via PayPal](https://paypal.me/ChristianScheb).

###  Health Score

71

—

ExcellentBetter than 100% of packages

Maintenance89

Actively maintained with recent releases

Popularity60

Solid adoption and visibility

Community32

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 88.4% 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

Every ~28 days

Recently: every ~15 days

Total

76

Last Release

55d ago

Major Versions

v6.13.1 → v7.7.02025-03-23

v7.13.0 → v8.0.02025-12-04

6.x-dev → v8.0.12025-12-18

v7.13.1 → v8.1.02025-12-28

7.x-dev → v8.4.02026-02-25

PHP version history (10 changes)v5.0.0PHP ^7.2.5

v5.0.1PHP &gt;=7.2.5

v6.0.0PHP ~8.0.0 || ~8.1.0

v6.4.0PHP ~8.0.0 || ~8.1.0 || ~8.2.0

v6.10.0PHP ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0

v7.0.0PHP ~8.2.0 || ~8.3.0

v7.6.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0

v6.13.1PHP ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0

v7.12.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

v8.0.0PHP ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/496658d46619a414a62b1e933fb7fc2e57eff4f0a4109f4cffc32093f57d65da?d=identicon)[scheb](/maintainers/scheb)

---

Top Contributors

[![scheb](https://avatars.githubusercontent.com/u/1259952?v=4)](https://github.com/scheb "scheb (1123 commits)")[![umpirsky](https://avatars.githubusercontent.com/u/208957?v=4)](https://github.com/umpirsky "umpirsky (18 commits)")[![Spomky](https://avatars.githubusercontent.com/u/1091072?v=4)](https://github.com/Spomky "Spomky (15 commits)")[![Seldaek](https://avatars.githubusercontent.com/u/183678?v=4)](https://github.com/Seldaek "Seldaek (10 commits)")[![maxhelias](https://avatars.githubusercontent.com/u/12966574?v=4)](https://github.com/maxhelias "maxhelias (8 commits)")[![j0k3r](https://avatars.githubusercontent.com/u/62333?v=4)](https://github.com/j0k3r "j0k3r (8 commits)")[![darookee](https://avatars.githubusercontent.com/u/104579?v=4)](https://github.com/darookee "darookee (7 commits)")[![Chris8934](https://avatars.githubusercontent.com/u/44963939?v=4)](https://github.com/Chris8934 "Chris8934 (6 commits)")[![AaronCritchley](https://avatars.githubusercontent.com/u/5992653?v=4)](https://github.com/AaronCritchley "AaronCritchley (5 commits)")[![danielburger1337](https://avatars.githubusercontent.com/u/48986191?v=4)](https://github.com/danielburger1337 "danielburger1337 (5 commits)")[![lcobucci](https://avatars.githubusercontent.com/u/201963?v=4)](https://github.com/lcobucci "lcobucci (4 commits)")[![PhilETaylor](https://avatars.githubusercontent.com/u/400092?v=4)](https://github.com/PhilETaylor "PhilETaylor (4 commits)")[![aturki](https://avatars.githubusercontent.com/u/13443190?v=4)](https://github.com/aturki "aturki (4 commits)")[![wouterj](https://avatars.githubusercontent.com/u/749025?v=4)](https://github.com/wouterj "wouterj (4 commits)")[![jmsche](https://avatars.githubusercontent.com/u/3929498?v=4)](https://github.com/jmsche "jmsche (4 commits)")[![dfridrich](https://avatars.githubusercontent.com/u/3758421?v=4)](https://github.com/dfridrich "dfridrich (4 commits)")[![dt-thomas-durand](https://avatars.githubusercontent.com/u/134489640?v=4)](https://github.com/dt-thomas-durand "dt-thomas-durand (4 commits)")[![zerkms](https://avatars.githubusercontent.com/u/302295?v=4)](https://github.com/zerkms "zerkms (3 commits)")[![Baptiste363](https://avatars.githubusercontent.com/u/183502461?v=4)](https://github.com/Baptiste363 "Baptiste363 (3 commits)")[![gnito-org](https://avatars.githubusercontent.com/u/70450336?v=4)](https://github.com/gnito-org "gnito-org (3 commits)")

---

Tags

2fasecuritysymfonysymfony-bundletwo-factor-authenticationsymfonysecurityAuthenticationtwo-factortwo-step

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/scheb-2fa/health.svg)

```
[![Health](https://phpackages.com/badges/scheb-2fa/health.svg)](https://phpackages.com/packages/scheb-2fa)
```

###  Alternatives

[scheb/2fa-bundle

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

7014.0M62](/packages/scheb-2fa-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)

PHPackages © 2026

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