HowTo: migrating from Two Factor Authenticator browser extension to 2FAuth
-
I have been using the Two Factor Authenticator browser extension for a while now. However, it's not been updated for a while. I also have to keep reminding myself to keep a copy of all the 2fa and also it's not really safe to have 2fa in a browser extension....
It's straightforward to migrate to the 2FAuth:
- First, export all the keys. Firefox -> Extension Preferences -> Export . This gives a json file.

- There is UI in 2FAuth to import keys. However, this wants a line separated otpuri . Syntax for this is
otpauth://TYPE/LABEL?PARAMETERS. Exampleotpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example. Maybe , chatgpt helps with the conversion here
But , I had this via node REPL:
$ node Welcome to Node.js v20.12.2. Type ".help" for more information. > data = JSON.parse(fs.readFileSync('/home/girish/Downloads/totp.json', 'utf8')) > data.otp_list.forEach(otp => console.log(`otpauth://totp/${encodeURIComponent(otp.name)}?secret=${otp.key}&issuer=${encodeURIComponent(otp.name)}`))-
The above will generate like this

-
Copy/paste the output into the Import UI of 2FAuth. That's it!

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login