Skip to content
Use the Google Authenticator App and check the code with this PHP script
Branch: 2.x
Clone or download
Pull request Compare This branch is 208 commits ahead of rande:master.
netniV and core23 Use different QR generation site as Google Chart API no longer suppor…
…ts QR codes (#137)

* Use different QR generation site as Google Chart API no longer supports QR codes

* Update tests to make Travis happy

* Correct other tests and update reference url

* Fix up GoogleAuthenticator test as it adds the issuer manually at the end
Latest commit 966d9c6 Mar 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github DevKit updates Jan 8, 2019
.travis DevKit updates Jan 23, 2019
docs DevKit updates (#131) Jan 15, 2019
sample Applied fixes from FlintCI Jan 23, 2019
src Use different QR generation site as Google Chart API no longer suppor… Mar 20, 2019
tests Use different QR generation site as Google Chart API no longer suppor… Mar 20, 2019
.editorconfig
.flintci.yml DevKit updates for 2.x branch (#122) Dec 4, 2018
.gitattributes
.gitignore Cleanup gitignore file Nov 28, 2016
.php_cs
.php_cs.dist
.styleci.yml DevKit updates (#93) Dec 4, 2017
.travis.yml
.yamllint
CHANGELOG.md 2.2.0 Jul 18, 2018
CONTRIBUTING.md
LICENSE
Makefile DevKit updates (#134) Feb 5, 2019
README.md
UPGRADE-1.x.md
UPGRADE-2.0.md
UPGRADE-2.x.md 2.1.0 Apr 9, 2018
composer.json bump symfony/phpunit-bridge Dec 11, 2018
phpunit.xml.dist

README.md

Google Authenticator

Build Status

Ported from http://code.google.com/p/google-authenticator/

You can use the Google Authenticator app from here 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

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

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

For questions and proposals you can post on this google groups

You can’t perform that action at this time.