Skip to content

Instantly share code, notes, and snippets.

@kamronbatman
Last active December 26, 2022 23:03
Show Gist options
  • Save kamronbatman/50bd4cbd82183eb929d56476bb8baed1 to your computer and use it in GitHub Desktop.
Save kamronbatman/50bd4cbd82183eb929d56476bb8baed1 to your computer and use it in GitHub Desktop.
Open Google Authenticator otpauth-migration URLs in Windows with otpauth

Exporting Google Authenticator

Install otpauth

  1. Download otpauth
  2. Extract all files to C:\otpauth. If you want a different location, modify the reg file path.
  3. Import otpauth-migration.reg

Extract OTPs

  1. Start the Google Authenticator > Transfer Accounts > Export Accounts process
  2. Take pictures of the QR codes using the Windows Camera App in document mode.
  3. Get URLs by importing the pictures using Google Lens
  4. Copy the URL and go to it in a browser Google Chrome, MS Edge, or some other browser.
  5. otpauth should run in a command line on http://localhost:6060.
    • Note: You can only run 1 export QR code at a time!
  6. Go to the otp page to view your OTPs.

Import into another authenticator

  1. Open your new authenticator (like 1Password).
  2. Right-click the QR code picture and choose "Copy Image"
  3. Choose the import QR Code option in your new authenticator.
  4. Verify the OTPs are correct (let it roll a few times).

WARNING: Storing your QR Codes from the Google Authenticator Transfer Accounts is a GIANT security risk. Delete the pictures from EVERYWHERE once you are done.

Notes:

  • Windows 11 has a security feature that prevents apps from opening URLs
  • In-app browsers generally do not handle custom protocol handlers
  • Windows 10/11 Camera QR Code scanner does not open custom handlers using cmd, and does not pass the data encoded properly to make it work.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\otpauth-migration]
"URL Protocol"=""
[HKEY_CLASSES_ROOT\otpauth-migration\shell]
[HKEY_CLASSES_ROOT\otpauth-migration\shell\open]
[HKEY_CLASSES_ROOT\otpauth-migration\shell\open\command]
@="cmd.exe /c \"cd C:\\otpauth & otpauth.exe -http=localhost:6060 -link %1\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment