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

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

xsuchy09/googleauthenticator
============================

Google Authenticator 2-factor authentication, fork from phpgangsta/googleauthenticator.

2.0.1(6y ago)1209BSD-4-ClausePHPPHP &gt;=7.2

Since Aug 21Pushed 6y agoCompare

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

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

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

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

- Copyright (c) 2019,
- Author: Petr Suchy,
- Licensed under the BSD License.

[![Build Status](https://camo.githubusercontent.com/8291f3c62ef821060beb6dca934f5e2c24044136015a0a954a4df8b2b52fc9c8/68747470733a2f2f7472617669732d63692e6f72672f78737563687930392f476f6f676c6541757468656e74696361746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/xsuchy09/GoogleAuthenticator)

Fork from:
----------

[](#fork-from)

[phpgangsta/googleauthenticator](https://github.com/PHPGangsta/GoogleAuthenticator)

Original copyright info:

- Copyright (c) 2012-2016,
- Author: Michael Kliewe, [@PHPGangsta](http://twitter.com/PHPGangsta) and [contributors](https://github.com/PHPGangsta/GoogleAuthenticator/graphs/contributors)
- Licensed under the BSD License.

Description:
------------

[](#description)

This PHP class can be used to interact with the Google Authenticator mobile app for 2-factor-authentication. This class can generate secrets, generate codes, validate codes and present a QR-Code for scanning the secret. 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 you could limit the amount of verifications to 10 tries within 10 minutes for one IP address (or IPv6 block). It depends on your environment.

Usage:
------

[](#usage)

See following example:

```
