PHPackages                             truesocialmetrics/google-authenticator - 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. truesocialmetrics/google-authenticator

ActiveLibrary

truesocialmetrics/google-authenticator
======================================

PHP repository for Google Authenticator

1.3.0(6y ago)06.1k↓100%GPL-3.0PHPPHP &gt;=7.4

Since Sep 19Pushed 6y ago1 watchersCompare

[ Source](https://github.com/truesocialmetrics/google-authenticator)[ Packagist](https://packagist.org/packages/truesocialmetrics/google-authenticator)[ Docs](https://github.com/truesocialmetrics/google-authenticator)[ RSS](/packages/truesocialmetrics-google-authenticator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

google-authenticator
====================

[](#google-authenticator)

> \[DEPRECATED\] use the [antonioribeiro/google2fa](https://github.com/antonioribeiro/google2fa) instead!

[![Latest Stable Version](https://camo.githubusercontent.com/1f178c3873e70eb9ee2fcab48233fddac677764251f9597a380749f5a11a2368/68747470733a2f2f706f7365722e707567782e6f72672f6c65616e64726f6c756761726573692f676f6f676c652d61757468656e74696361746f722f762f737461626c652e737667)](https://packagist.org/packages/leandrolugaresi/google-authenticator) [![Total Downloads](https://camo.githubusercontent.com/67dba5a4f6b7de95dd5e2fc27e36bab9fb2719813d8a88b5c47f79ebdcf17e5d/68747470733a2f2f706f7365722e707567782e6f72672f6c65616e64726f6c756761726573692f676f6f676c652d61757468656e74696361746f722f646f776e6c6f6164732e737667)](https://packagist.org/packages/leandrolugaresi/google-authenticator) [![Latest Unstable Version](https://camo.githubusercontent.com/b5c3ce6c75693c26fe1ccffbb81dcb90c51bb9167565154b514365b751b85091/68747470733a2f2f706f7365722e707567782e6f72672f6c65616e64726f6c756761726573692f676f6f676c652d61757468656e74696361746f722f762f756e737461626c652e737667)](https://packagist.org/packages/leandrolugaresi/google-authenticator) [![License](https://camo.githubusercontent.com/d10e5d54b22b79f8f115e3476b102c96fb5f99abc77f9f8cba463625d7dd1a7b/68747470733a2f2f706f7365722e707567782e6f72672f6c65616e64726f6c756761726573692f676f6f676c652d61757468656e74696361746f722f6c6963656e73652e737667)](https://packagist.org/packages/leandrolugaresi/google-authenticator)[ ![Codeship Status for leandro-lugaresi/google-authenticator](https://camo.githubusercontent.com/5b0491ca1974bffa4e247c75051b953f335602793e337052b92cdba6dc2d119c/68747470733a2f2f7777772e636f6465736869702e696f2f70726f6a656374732f63353666303265302d323438392d303133322d656430642d3565386366373135633731632f7374617475733f6272616e63683d6d6173746572)](https://www.codeship.io/projects/36901)

Introduction
------------

[](#introduction)

This is a module to integrate web sites with Google Authenticator.

Requirements
------------

[](#requirements)

- [ChristianRiesen/base32](https://github.com/ChristianRiesen/base32) (1.2)
- [zendframework/zend-math](https://github.com/zendframework/zf2) (&gt;2.2.\*)

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

[](#installation)

1. Add this project in your composer.json:

```
    "require": {
        "leandrolugaresi/google-authenticator": "1.0.*"
    }
```

2. Now tell the composer to download the repository by running the command:

```
    $ php composer.phar update
```

Usage
-----

[](#usage)

### Step 1 - Register application

[](#step-1---register-application)

Show the QrCode and the form:

```
    $googleAuth = new \GoogleAuthenticator\GoogleAuthenticator();
    $googleAuth->setIssuer('YourApplicationName');
    //save the secretKey to register after
    $_SESSION['secretKeyTemp'] = $googleAuth->getSecretKey();

    // Show the qrcode to register
    //this param is an identifier of the user in this application
    echo $googleAuth->getQRCodeUrl($user->username.'@YourApplicationName');
```

Verify the code from form and save the secretKey of this user:

```
    $google = new GoogleAuthenticator($_SESSION['secretKeyTemp']);
    $userSubmitCode = $_POST['codeFoo'];
    if ($google->verifyCode($userSubmitCode)) {
        //save the secretKey of this user
    }
```

### Step 2 - Verify Code at login

[](#step-2---verify-code-at-login)

```
    $google = new GoogleAuthenticator($user->getSecretKey());
    $userSubmitCode = $_POST['codeFoo'];

    // Verify Code
    if ($google->verifyCode($userSubmitCode)) {

        // OK - aloowed login
    }
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 76.9% 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 ~674 days

Total

4

Last Release

2228d ago

PHP version history (3 changes)1.0.0PHP &gt;=5.3.3

1.2.0PHP &gt;=7.1

1.3.0PHP &gt;=7.4

### Community

Maintainers

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

---

Top Contributors

[![leandro-lugaresi](https://avatars.githubusercontent.com/u/858713?v=4)](https://github.com/leandro-lugaresi "leandro-lugaresi (10 commits)")[![necromant2005](https://avatars.githubusercontent.com/u/159874?v=4)](https://github.com/necromant2005 "necromant2005 (2 commits)")[![soullivaneuh](https://avatars.githubusercontent.com/u/1698357?v=4)](https://github.com/soullivaneuh "soullivaneuh (1 commits)")

---

Tags

phpgoogleauthenticator

### Embed Badge

![Health badge](/badges/truesocialmetrics-google-authenticator/health.svg)

```
[![Health](https://phpackages.com/badges/truesocialmetrics-google-authenticator/health.svg)](https://phpackages.com/packages/truesocialmetrics-google-authenticator)
```

###  Alternatives

[gdg-tangier/cloud-pubsub

Google Cloud pub-sub for laravel

5054.9k](/packages/gdg-tangier-cloud-pubsub)

PHPackages © 2026

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