PHPackages                             comes/simpleauthenticator - 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. comes/simpleauthenticator

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

comes/simpleauthenticator
=========================

A PHP library for implementing Google Authenticator's two-factor authentication (2FA) with Laravel, ensuring enhanced security for user authentication.

v2.1(1y ago)010.2k1[5 PRs](https://github.com/comes/SimpleAuthenticator/pulls)MITPHPPHP ^8.3CI passing

Since May 17Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/comes/SimpleAuthenticator)[ Packagist](https://packagist.org/packages/comes/simpleauthenticator)[ Docs](https://github.com/comes/simpleauthenticator)[ RSS](/packages/comes-simpleauthenticator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (10)Versions (10)Used By (0)

This is a simple implementation of the google authenticator algorithm
=====================================================================

[](#this-is-a-simple-implementation-of-the-google-authenticator-algorithm)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3d8fa068efada7d9f399ea8c9dec12c30e764d3efe89caf767716044d388046f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f6d65732f73696d706c6561757468656e74696361746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/comes/simpleauthenticator)[![GitHub Tests Action Status](https://camo.githubusercontent.com/4873990d71b92f01188bdfc11118ae5a5c2e0736275f2fe2c44454c60a63812c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f6d65732f73696d706c6561757468656e74696361746f722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/comes/simpleauthenticator/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/ba0a8b7804952295b56a72e9b18fae683d8ef1b7efbdd009d05fc0894b286a74/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636f6d65732f73696d706c6561757468656e74696361746f722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/comes/simpleauthenticator/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/8e663681eef158b13cb8643cde4dfef28a3e112e1473da7c76e9340047a4c8a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f6d65732f73696d706c6561757468656e74696361746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/comes/simpleauthenticator)

The SimpleAuthenticator package provides a straightforward implementation of the Google Authenticator algorithm for Laravel applications. It enables easy generation of one-time passwords (OTPs) based on a provided secret key.

Read more about the Google Authenticator algorithm in the [RFC 6238](https://tools.ietf.org/html/rfc6238) or check wikipedia [TOTP](https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm)

Usage
-----

[](#usage)

To use the SimpleAuthenticator, create an instance of the SimpleAuthenticator class by providing the secret key. Then, you can call the `generate()` method to generate the one-time password.

```
use Comes\SimpleAuthenticator\SimpleAuthenticator;

$secret = 'YOUR_SECRET_KEY';
$authenticator = new SimpleAuthenticator;
$oneTimePassword = $authenticator->generate($secret);
```

Laravel Integration
-------------------

[](#laravel-integration)

The SimpleAuthenticator package provides a Laravel command to generate OTPs. To use it, you need to publish the package configuration and add the secret keys to the configuration file.

```
php artisan vendor:publish --provider="Comes\SimpleAuthenticator\SimpleAuthenticatorServiceProvider" --tag="config"
```

After publishing the configuration, you can add your secret keys to the config/simpleauthenticator.php file. Then, you can use the `otp` command to generate an OTP for a specific app:

```
php artisan otp app-name
```

Testing
-------

[](#testing)

Testing

You can run the tests using Pest:

```
composer test
composer test-coverage
```

Changelog
---------

[](#changelog)

Please see the [Latest Release](https://github.com/comes/simpleauthenticator/releases) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Jeremias Wolff](https://github.com/comes)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance64

Regular maintenance activity

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 59.6% 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 ~230 days

Total

4

Last Release

406d ago

Major Versions

v1.0.0 → v2.0.02023-05-19

PHP version history (2 changes)v1.0.0PHP ^8.1

v2.0.1PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1f33c771864c52aeb25123bd103b4e3484782a76ee12d996919cd64c8e5474e?d=identicon)[comes](/maintainers/comes)

---

Top Contributors

[![comes](https://avatars.githubusercontent.com/u/592262?v=4)](https://github.com/comes "comes (34 commits)")[![bilfeldt](https://avatars.githubusercontent.com/u/30228807?v=4)](https://github.com/bilfeldt "bilfeldt (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laravelgoogle authenticatorsecurityAuthentication2faComes

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/comes-simpleauthenticator/health.svg)

```
[![Health](https://phpackages.com/badges/comes-simpleauthenticator/health.svg)](https://phpackages.com/packages/comes-simpleauthenticator)
```

###  Alternatives

[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)[sicaboy/laravel-mfa

A Laravel package of Multi-factor Authentication (MFA/2FA) with a middleware.

101.2k](/packages/sicaboy-laravel-mfa)

PHPackages © 2026

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