Using Your YubiKey with Authenticator Codes and GMail

Applicable Products

Following are instructions so you can protect your Gmail account with YubiKeys that do not currently support U2F. It relies on a free application called the Yubico Authenticator (that works on Windows, Mac, or Linux operating systems) to generate time-based authentication codes.


  • Shared OATH-TOTP secret from Gmail account settings
  • YubiKey version 2.2 or later
  • Microsoft Windows or Mac operating system (OS X or macOS)
  • Yubico Authenticator for Desktop application (our free application, available from Downloads) TIP: You can also use Google Authenticator if desired.

How to enable YubiKey + Gmail for Windows or Mac

  1. If you have not already done so, install Yubico Authenticator.
  2. In Gmail, enable two-step verification.
  3. Follow the prompts, including setting up a backup method of authentication, until the QR code is displayed.
  4. Open Yubico Authenticator.
  5. Insert a YubiKey (YubiKey Standard, YubiKey Edge) into the USB port of your computer.
  6. Select File > Add.
  7. Click Scan a QR Code.
  8. If desired, change the name of the credential and click OK.
  9. Enter the six digit code in the Gmail screen.
That's it! The next time you log in to your Gmail account, you are prompted to enter your six digit code.

Logging in to Your Gmail Account

  1. Enter your user name and password as usual.
  2. Launch Yubico Authenticator for Desktop, and insert your YubiKey. The code is shown next to the service's credential.
  3. Enter the code and click Sign In. If prompted, touch your YubiKey. TIP: In Yubico Authenticator for Desktop, you can double-click the code, and then paste it into the field for the authenticator code.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.