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

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

pvsv1984/lumen-2fa
==================

A One Time Password Authentication package, compatible with Google Authenticator. Authenticates oauth tokens

v0.1.6.1(4y ago)03BSD-3-ClausePHPPHP &gt;=7.0

Since Sep 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/pvsv1984/lumen-2fa)[ Packagist](https://packagist.org/packages/pvsv1984/lumen-2fa)[ RSS](/packages/pvsv1984-lumen-2fa/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

Google2FA for Lumen
===================

[](#google2fa-for-lumen)

### Google Two-Factor Authentication Package for Lumen

[](#google-two-factor-authentication-package-for-lumen)

Package install: composer require pvsv1984/lumen-2fa

Google2FA is a PHP implementation of the Google Two-Factor Authentication Module, supporting the HMAC-Based One-time Password (HOTP) algorithm specified in [RFC 4226](https://tools.ietf.org/html/rfc4226) and the Time-based One-time Password (TOTP) algorithm specified in [RFC 6238](https://tools.ietf.org/html/rfc6238).

This package is a Lumen update to to [Google2FA for Laravel](https://packagist.org/packages/pragmarx/google2fa) package.

The intent of this package is to create a microservice safe way to implement 2FA Code and check responses against user.

### Recovery/Backup codes

[](#recoverybackup-codes)

if you need to create recovery or backup codes to provide a way for your users to recover a lost account, you can use the [Recovery Package](https://github.com/antonioribeiro/recovery).

### Installation on Lumen

[](#installation-on-lumen)

Add the Service Provider to your `bootstrap/app.php`

```
Lshtmweb\Lumen2FA\TwoFactorServiceProvider::class

```

This package assumes you are using Dusterio passport for api authentication and have the standard oauth\_tables. Feel free to change the migrations to suit your needs.

### Publish the config file and migrations

[](#publish-the-config-file-and-migrations)

```
php artisan vendor:publish --provider="Lshtmweb\Lumen2FA\TwoFactorServiceProvider::class"

```

### Usage

[](#usage)

The standard routes have already been set up for you. You can change to suit your need by adding routes and pointing to the correct Controller methods.

- Add the middleware
    - In route middleware add a new middleware or use the default one `lumen2fa` to secure your routes.

### Events Fired

[](#events-fired)

- TwoFactorActivatedEvent
- TwoFactorBeforeDisableEvent
- TwoFactorDisabledEvent
- TwoFactorInfoGeneratedEvent

### Using Laravel? Try this instead

[](#using-laravel-try-this-instead)

[Google2FA for Laravel](https://packagist.org/packages/pragmarx/google2fa)

### Changes

[](#changes)

Pull requests are welcome

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~332 days

Total

5

Last Release

1460d ago

PHP version history (2 changes)v0.1.3PHP &gt;=5.6.4

v0.1.6PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/14fec8fe995343b33a1314fd5a94e7d119e91d3b6ee7be723712cd6326fa003b?d=identicon)[pvsv1984](/maintainers/pvsv1984)

---

Top Contributors

[![pvsv1984](https://avatars.githubusercontent.com/u/16245939?v=4)](https://github.com/pvsv1984 "pvsv1984 (5 commits)")

---

Tags

laravelAuthenticationlumenTwo Factor Authenticationgoogle2fa

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[pragmarx/google2fa-laravel

A One Time Password Authentication package, compatible with Google Authenticator.

1.0k15.5M63](/packages/pragmarx-google2fa-laravel)[pragmarx/google2fa-qrcode

QR Code package for Google2FA

12024.6M37](/packages/pragmarx-google2fa-qrcode)

PHPackages © 2026

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