Download the PHP package enygma/gauth without Composer
On this page you can find all versions of the php package enygma/gauth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package gauth
Short Description PHP library to generate codes compatible with the Google Authenticator clients
License MIT
Homepage https://github.com/enygma/gauth.git
Informations about the package gauth
GAuth : Google Authenticator Code Generator/Validation
The GAuth
library is designed to generate and validate codes compatible with the
Google Authenticator tools.
Installation via Composer:
Include in your composer.json
file:
Getting Started
To get started using the Google Authenticator with your application, you'll need to make an
initialization key (using generateCode
) and save that to your app's settings. This is the
code you'll share with your users when they're trying to set up their client for your system.
Then, when they log in you have them enter in the latest code listed for your application for thier account.
NOTE: This tool offers a "window of opportunity" for the codes of 2 seconds forward and
backward of the current timestamp, just in case things are a bit off. You can change this with
the setRange
method:
To generate a new code:
To validate a code
To get the QR code for the application
You can also use the tool to get the URL for a QR code users can scan to add your application to their Authenticator client. The call to generateQrImage
returns the actual image data for you to use as you wish, either to embed in an img
tag or save to a file:
The library uses internal QR code generation, not the Google Charts API many similar libraries use.