From 12efab5e45a57d2394aa4dde7af3bcfe907c7780 Mon Sep 17 00:00:00 2001 From: Gray Date: Fri, 7 Apr 2017 01:29:32 -0400 Subject: [PATCH] Update README.md --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cf5e7dc..e76902f 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,14 @@ You can use this code with the Google Authenticator mobile app or the Authy mobi * Browse the code on the [git repository](https://github.com/j256/two-factor-auth). [![CircleCI](https://circleci.com/gh/j256/two-factor-auth.svg?style=svg)](https://circleci.com/gh/j256/two-factor-auth) * Maven packages are published via the [maven central repo](http://repo1.maven.org/maven2/com/j256/two-factor-auth/two-factor-auth/). -To get this to work you: +## To get this to work you: 1. Use `generateBase32Secret()` to generate a secret key for a user. 2. Store the secret key in the database associated with the user account. 3. Display the QR image URL returned by `qrImageUrl(...)` to the user. 4. User uses the image to load the secret key into his authenticator application. -Whenever the user logs in: +## Whenever the user logs in: 1. The user enters the number from the authenticator application into the login form. 2. Read the secret associated with the user account from the database. @@ -23,3 +23,10 @@ Whenever the user logs in: 4. If they are equal then the user is allowed to log in. For more details, see the [example program](https://github.com/j256/two-factor-auth/blob/master/src/test/java/com/j256/twofactorauth/TwoFactorAuthExample.java). + +## Sample QR Image + +The following is a sample QR image generated by GoogleAPIs URL. It is the QR code for the base-32 encoded +secret `"NY4A5CPJZ46LXZCP"`. See the [example program](https://github.com/j256/two-factor-auth/blob/master/src/test/java/com/j256/twofactorauth/TwoFactorAuthExample.java) for more details. + +![Sample QR Image](https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=200x200&chld=M|0&cht=qr&chl=otpauth://totp/user@j256.com%3Fsecret%3DNY4A5CPJZ46LXZCP)