PHPackages                             vinyvicente/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. vinyvicente/google-authenticator

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

vinyvicente/google-authenticator
================================

PHP repository for Google Authenticator

v1.1(7y ago)0124GPL-3.0PHPPHP &gt;=5.6

Since Sep 19Pushed 7y ago1 watchersCompare

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

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

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

[](#google-authenticator)

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": {
        "vinyvicente/google-authenticator": "1.1"
    }
```

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

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

Usage
-----

[](#usage)

\###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

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

    // Verify Code
    if ($google->verifyCode($userSubmitCode)) {
        // OK - allowed login
    }
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 81.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

Every ~755 days

Total

3

Last Release

2749d ago

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

v1.1PHP &gt;=5.6

### Community

Maintainers

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

---

Top Contributors

[![leandro-lugaresi](https://avatars.githubusercontent.com/u/858713?v=4)](https://github.com/leandro-lugaresi "leandro-lugaresi (9 commits)")[![vinyvicente](https://avatars.githubusercontent.com/u/513934?v=4)](https://github.com/vinyvicente "vinyvicente (2 commits)")

---

Tags

phpgoogleauthenticator

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[robthree/twofactorauth

Two Factor Authentication

1.2k10.5M66](/packages/robthree-twofactorauth)[enygma/gauth

PHP library to generate codes compatible with the Google Authenticator clients

75129.0k1](/packages/enygma-gauth)[2amigos/2fa-library

2 Factor Authentication (2FA) library

34367.1k7](/packages/2amigos-2fa-library)

PHPackages © 2026

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