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

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

muonium/google-authenticator
============================

Library to integrate Google Authenticator into a PHP project

2.2.0(7y ago)077[1 issues](https://github.com/muonium/GoogleAuthenticator/issues)MITPHPPHP ^5.6 || ^7.0

Since May 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/muonium/GoogleAuthenticator)[ Packagist](https://packagist.org/packages/muonium/google-authenticator)[ Docs](https://github.com/muonium/GoogleAuthenticator)[ RSS](/packages/muonium-google-authenticator/feed)WikiDiscussions 2.x Synced 3d ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Google Authenticator
====================

[](#google-authenticator)

[![Build Status](https://camo.githubusercontent.com/4408d442f8747e20b1cd815b520dfabfaa54bcf0a6c6b3ff55c90b5eb629fcba/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f736f6e6174612d70726f6a6563742f476f6f676c6541757468656e74696361746f722e706e67)](https://secure.travis-ci.org/#!/sonata-project/GoogleAuthenticator)

Ported from

You can use the Google Authenticator app from here [http://www.google.com/support/accounts/bin/answer.py?hl=en&amp;answer=1066447](http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=1066447)to generate One Time Passwords/Tokens and check them with this little PHP app (Of course, you can also create them with this).

### Installation using Composer

[](#installation-using-composer)

Add the dependency:

```
php composer.phar require sonata-project/google-authenticator
```

If asked for a version, type in 'dev-master' (unless you want another version):

```
Please provide a version constraint for the sonata-project/google-authenticator requirement: dev-master
```

Usage
-----

[](#usage)

See example.php for how to use it.

There's a little web app showing how it works in web/, please make users.dat writeable for the webserver, doesn't really work otherwise (it can't save the secret). Try to login with chregu/foobar.

What's missing in the example:

- Prevent replay attacks. One token should only be used once
- Show QR Code only when providing password again (or not at all)
- Regenerate secret

### Google Groups

[](#google-groups)

For questions and proposals you can post on this google groups

- [Sonata Users](https://groups.google.com/group/sonata-users): Only for user questions
- [Sonata Devs](https://groups.google.com/group/sonata-devs): Only for devs

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~0 days

Total

2

Last Release

2914d ago

### Community

Maintainers

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

---

Top Contributors

[![SonataCI](https://avatars.githubusercontent.com/u/12843093?v=4)](https://github.com/SonataCI "SonataCI (98 commits)")[![greg0ire](https://avatars.githubusercontent.com/u/657779?v=4)](https://github.com/greg0ire "greg0ire (22 commits)")[![chregu](https://avatars.githubusercontent.com/u/47106?v=4)](https://github.com/chregu "chregu (17 commits)")[![soullivaneuh](https://avatars.githubusercontent.com/u/1698357?v=4)](https://github.com/soullivaneuh "soullivaneuh (17 commits)")[![core23](https://avatars.githubusercontent.com/u/3440437?v=4)](https://github.com/core23 "core23 (13 commits)")[![rande](https://avatars.githubusercontent.com/u/14672?v=4)](https://github.com/rande "rande (7 commits)")[![jordisala1991](https://avatars.githubusercontent.com/u/1137485?v=4)](https://github.com/jordisala1991 "jordisala1991 (5 commits)")[![linaori](https://avatars.githubusercontent.com/u/1754678?v=4)](https://github.com/linaori "linaori (3 commits)")[![lstrojny](https://avatars.githubusercontent.com/u/79707?v=4)](https://github.com/lstrojny "lstrojny (3 commits)")[![zerkms](https://avatars.githubusercontent.com/u/302295?v=4)](https://github.com/zerkms "zerkms (2 commits)")[![dclement8](https://avatars.githubusercontent.com/u/19585678?v=4)](https://github.com/dclement8 "dclement8 (2 commits)")[![dylangallin](https://avatars.githubusercontent.com/u/51544267?v=4)](https://github.com/dylangallin "dylangallin (2 commits)")[![OskarStark](https://avatars.githubusercontent.com/u/995707?v=4)](https://github.com/OskarStark "OskarStark (2 commits)")[![scottrobertson](https://avatars.githubusercontent.com/u/68361?v=4)](https://github.com/scottrobertson "scottrobertson (1 commits)")[![Rotzbua](https://avatars.githubusercontent.com/u/7337347?v=4)](https://github.com/Rotzbua "Rotzbua (1 commits)")[![petski](https://avatars.githubusercontent.com/u/116610?v=4)](https://github.com/petski "petski (1 commits)")[![alvaroveliz](https://avatars.githubusercontent.com/u/224408?v=4)](https://github.com/alvaroveliz "alvaroveliz (1 commits)")

---

Tags

google authenticator

### Embed Badge

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

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

###  Alternatives

[spomky-labs/otphp

A PHP library for generating one time passwords according to RFC 4226 (HOTP Algorithm) and the RFC 6238 (TOTP Algorithm) and compatible with Google Authenticator

1.5k46.1M119](/packages/spomky-labs-otphp)[scheb/2fa-google-authenticator

Extends scheb/2fa-bundle with two-factor authentication using Google Authenticator

298.2M30](/packages/scheb-2fa-google-authenticator)

PHPackages © 2026

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