Skip to content

asaph/twofactorauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Authenticator compatible 2-Factor Auth in Java

This project serves as an example of how to build a 2fa support into your website or app. It is the companion code to this blog entry.

Requirements:

  • Java 8
  • Maven 3.x
  • Google Authenticator app (available free in the Apple App Store and Google Play)

Building

To complile the code and package into a jar run:

mvn clean install

Running

To execute the example code run:

mvn exec:java
  1. Note the path shown for the generated QR code PNG file and open that file in your web browser (or any other image viewer).
  2. Use the Google Authenticator app on your mobile device to scan the QR code.
  3. Confirm that the 6 digit codes generated by the example code match the 6 digit codes generated by the Google Authenticator app.
  4. Press ctrl-c at any time to terminate the example program.

License

All code is licensed under the commercial-friendly BSD 2-Clause "Simplified" License.

About

Google Authenticator compatible 2-Factor Auth in Java

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages