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

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

tekintian/google-authenticator
==============================

谷歌的两步验证PHP服务端，Google身份验证器 Google Authenticator PHP实现，Google Authenticator 2-factor authentication

1.0.1(6y ago)82663BSD-4-ClausePHPPHP &gt;=5.6

Since Jun 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/tekintian/google-authenticator)[ Packagist](https://packagist.org/packages/tekintian/google-authenticator)[ RSS](/packages/tekintian-google-authenticator/feed)WikiDiscussions master Synced today

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

Google Authenticator + base64 qrcode PHP class
==============================================

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

谷歌的两步验证PHP服务端，Google身份验证器 Google Authenticator PHP实现，自带二维码生成类库， 再也不用担心服务端密码泄露问题了！

PS: 本工具为安全类工具，$secret 为本工具安全的基础， 如果$secret 泄露，则本工具失去安全的意义！ 网上其他类似工具使用的第三方API生成二维码的方式是极不安全的！！！

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)

- install dependency with composer

```
composer require tekintian/google-authenticator
```

- usage example:

```
