Skip to content

Instantly share code, notes, and snippets.

@gatherKnowledge
Last active May 4, 2017 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gatherKnowledge/e6ae9034bd2e4f4cd02e20b942c3f0b0 to your computer and use it in GitHub Desktop.
Save gatherKnowledge/e6ae9034bd2e4f4cd02e20b942c3f0b0 to your computer and use it in GitHub Desktop.
Google - Authentication
//* POINT
//throght the url(included the secret number), Your server and user's smart phone became a sync
public static String getQRBarcodeURL(String user, String host, String secret) {
String format = "http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=otpauth://totp/%s@%s%%3Fsecret%%3D%s&chld=H|0";
return String.format(format, user, host, secret);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment