robbiev / two-factor-auth

Generate 2FA tokens compatible with Google Authenticator

Home Page:http://garbagecollected.org/2014/09/14/how-google-authenticator-works/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Manual Entry doesn't work

microwavehead opened this issue · comments

commented

The ManualEntryKey doesn't work with the Google Authenticator app to create a new account. The key generated seems to be too short and in the incorrect format. The format expected is xxxx xxxx xxxx xxxx xxxx xxxx

How do you generate that style of key for use with manual entry?

The secret is only available when you activate two-factor. Once set up, Google or its two factor app don't allow you to retrieve it again for security reasons.

When you first enable the authenticator on Google you can either scan a QR code or on the QR code screen say "can't scan" which will take you to the text version of the key. This text version of the key is what you can use with the sample code provided here. You can also add it manually to Google Authenticator as per the instructions on the page there to verify the results are the same. I've just tried this and it works.

Alternatively you can scan the QR code with some app that will give you the raw data. I believe it's some sort of URL with the code embedded, so that's another way to get it.