PHPackages                             sethadam1/googleauthenticator - 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. sethadam1/googleauthenticator

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

sethadam1/googleauthenticator
=============================

Google Authenticator 2-factor authentication

02↓100%PHPCI passing

Since May 20Pushed 2w agoCompare

[ Source](https://github.com/sethadam1/GoogleAuthenticator)[ Packagist](https://packagist.org/packages/sethadam1/googleauthenticator)[ RSS](/packages/sethadam1-googleauthenticator/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Google Authenticator PHP class
==============================

[](#google-authenticator-php-class)

Forked and maintained by [Adam Scheinberg](https://sethadam1.com) ([GitHub](https://github.com/sethadam1)) (2026). This is a fork of [PHPGangsta/GoogleAuthenticator](https://github.com/PHPGangsta/GoogleAuthenticator) with PHP 8.2+ modernization, updated class naming, and Packagist packaging. Released under the same BSD-4-Clause license. See LICENSE.md for details.

- Original author: Michael Kliewe, [@PHPGangsta](http://twitter.com/PHPGangsta) and [contributors](https://github.com/PHPGangsta/GoogleAuthenticator/graphs/contributors)
- Copyright (c) 2012-2016,
- Copyright (c) 2026, [Adam Scheinberg](https://sethadam1.com)

This PHP class can be used to interact with the Google Authenticator mobile app for 2-factor-authentication. It can generate secrets, generate codes, validate codes, and produce a QR code URL for scanning. It implements TOTP according to [RFC6238](https://tools.ietf.org/html/rfc6238).

For a secure installation you have to make sure that used codes cannot be reused (replay-attack). You also need to limit the number of verifications to fight against brute-force attacks. For example, limit attempts to 10 tries within 10 minutes per IP address (or IPv6 block).

Requirements:
-------------

[](#requirements)

- PHP 8.2 or higher
- Tested on PHP 8.2, 8.3, 8.4, and 8.5

Installation:
-------------

[](#installation)

```
composer require sethadam1/googleauthenticator

```

Or add to your `composer.json`:

```
{
    "require": {
        "sethadam1/googleauthenticator": "^1.0"
    }
}
```

Usage:
------

[](#usage)

```
