How to generate a QR Code for Google Authenticator that correctly shows Issuer displayed above the OTP?

Mark J. Bobak picture Mark J. Bobak · Dec 30, 2015 · Viewed 49.2k times · Source

Warning: sharing your TOTP seed with third-parties breaks the very basic assumption of multi-factor authentication that the TOTP seed is secret.

So, I'm aware of the documentation on this, found here: Google Authenticator Key URI Format

When I follow this example from that page:

otpauth://totp/Example:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Example

And I 'splice' it into a Google Charts URL, thus:

https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/Example:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Example

It will display a valid QR code, and if I scan it with my Google Authenticator app on my phone, it will begin to generate valid OTPs.

However, in the display on the phone, for the entry created by the QR code, I get the OTP, and under it, I get 'Example:[email protected]'. What I want, is to have 'Example' displayed above the OTP, and '[email protected]' displayed below the OTP. I can't help but notice that's the way all the professionally produced apps do it. For example, Google, Wordpress, Amazon, etc. The company name is above the OTP, and the username is displayed below the OTP. Yes, this is purely a cosmetic issue, but I want to get it right.

Can anyone offer me a clue?

Answer

Alex picture Alex · Aug 12, 2016

I use a different way using a local qrencode installation:

qrencode -o- -d 300 -s 10 "otpauth://totp/YOUR_IDENTIFICATION?secret=YOUR_SECRET" | display

In this way I can rebuild mt lost authentication key library from what I had on my laptop.