Using Your YubiKey with Authenticator Codes


These instructions show you how to set up your YubiKey so that you can use two-factor authentication to sign in to any account that requires authenticator codes. For a comprehensive list of sites known to support authenticator codes for two-factor authentication, refer to the Works with YubiKey Catalog.

 

Tip: For enhanced security, consider confirming if the service also supports FIDO2 or FIDO U2F, which adds additional protection against phishing. 

 

To use a code at one of these sites, you would typically use an application, such as Google Authenticator, to generate the codes. The codes generated are OATH-TOTP codes, a type of one-time password, that are usually six-digits, and generated based on the current time. You can use Yubico Authenticator, which is similar to Google Authenticator, in conjunction with your YubiKey. Yubico Authenticator is available for Desktop, iOS, and Android.

Note: Once an account is added, codes can be generated for that account from any device running Yubico Authenticator, in conjunction with your YubiKey.

 

To see a comprehensive guide for the Yubico Authenticator application, which also covers managing other YubiKey applications such as FIDO and PIV, see the Yubico Authenticator User Guide.

 

Setting Up Your YubiKey in Yubico Authenticator 7.0+ for Desktop

Requirements

Instructions

  1. Enable two-factor authentication for your service. Usually, you will do this by selecting Settings or Security, and then selecting the option to Enable two-factor authentication. Tip: Some services call this "two-step verification."
  2. Select the option to use a mobile app, or Google Authenticator. A QR code should appear.
manual-icon.svg If you are planning to register more than one YubiKey with this
service please save a copy of the QR code, or secret key as you
will need it when registering more keys.
  1. Open Yubico Authenticator for Desktop and plug in your YubiKey.
  2. Tap the hamburger menu on the top left and select the "Accounts" section to the left of application. 
    Screenshot 2024-07-09 at 10.37.54 AM.png
  3. Select Add Account
    Screenshot 2024-07-09 at 10.38.42 AM.png
  4. You will be presented with a form to fill in the information into the application. If you have a QR code, make sure the QR code is visible on the screen and select the Scan QR Code button.
    Screenshot 2024-07-09 at 10.40.03 AM.png
  5. A successful QR Code scan will auto-fill Issuer, Account name, and Secret key.
    Screenshot 2024-07-09 at 10.42.11 AM.png
  6. Before adding the credential, you have the option to adjust the following settings.
    Screenshot 2024-07-09 at 10.42.11 AM 2.png
    Note:
     these cannot be adjusted after saving the credential.
    • Issuer - Defines the service name
    • Account name - Defines the account holder name
    • Require touch - Toggles the requirement to touch the YubiKey in order to display the OATH code on (checked) or off (unchecked). Note that this is set on a per-credential basis; in other words, each credential can have this set differently.
  7. Once you have all the options as you desire, select Save on the upper right
  8. It should now go back to the main screen and you should see the entry.
    • Note: to copy the code, hold click on the code, until you see it say you have copied the code at the bottom
      Screenshot 2024-07-09 at 10.47.03 AM.png
  9. Complete the setup process on the website. This typically involves entering a one-time password from Yubico Authenticator, and potentially re-entering your login password.

You can repeat the process for other YubiKeys for backup using the same account.

You have successfully configured your YubiKey for authenticator codes!


Setting Up Your YubiKey in Legacy Yubico Authenticator for Desktop

Requirements

Instructions

  1. Enable two-factor authentication for your service. Usually, you will do this by selecting Settings or Security, and then selecting the option to Enable two-factor authentication. Tip: Some services call this "two-step verification."
  2. Select the option to use a mobile app, or Google Authenticator. A QR code should appear.
manual-icon.svg If you are planning to register more than one YubiKey with this
service please save a copy of the QR code, or secret key as you
will need it when registering more keys.
  1. Open Yubico Authenticator for Desktop and plug in your YubiKey.
  2. Click the YubiKey icon at the top right and select Add account.
  3. Click Scan QR code. If the scan attempt fails, ensure the QR code is visible on the same screen as Yubico Authenticator. A successful QR Code scan will auto-fill Issuer, Account name, and Secret key.
  4. Before adding the credential, you have the option to adjust the following settings. Note: these cannot be adjusted after saving the credential.
    • Issuer - Defines the service name
    • Account name - Defines the account holder name
    • Require touch - Toggles the requirement to touch the YubiKey in order to display the OATH code on (checked) or off (unchecked). Note that this is set on a per-credential basis; in other words, each credential can have this set differently.
  5. Once you are satisfied with the configuration, click Save.
  6. If you have one or more backup YubiKeys, unplug the YubiKey that is currently plugged in, insert one of your backup keys, and follow through steps 4-7 again. Consider saving a copy of the QR code (or secret key) somewhere safe so you have the ability to program the credential into future backup YubiKeys, etc.
  7. Complete the setup process on the website. This typically involves entering a one-time password from Yubico Authenticator, and potentially re-entering your login password.

You have successfully configured your YubiKey for authenticator codes!


Logging on to Your Account

Once you have configured your account with a service for authenticator app two-factor authentication, you must use a code generated by Yubico Authenticator when logging in to that service.

  1. Launch Yubico Authenticator.
  2. On the device you want to sign in to your account with, begin logging in by entering your user name and password as normal.
  3. Find the authenticator code you need in Yubico Authenticator:
    • Desktop: Insert your YubiKey. The code is shown next to the service's credential.
    • Mobile:
      • iOS: Insert your YubiKey 5Ci into your device's Lightning port, or "pull down" to activate NFC, if connecting your YubiKey over NFC. When prompted, scan your key if you are using NFC. The code should be displayed in the app. If the credential in question is set to require touch, you will need to touch your YubiKey's sensor (in the case of a YubiKey 5Ci), or scan your key again (if using NFC).
      • Android: Launch Yubico Authenticator for Android, and tap and hold your NFC-enabled YubiKey against the NFC antenna on the back of your phone. The code is shown next to the service's credential. Note: For generating codes set to require touch, you will need to tap the "refresh" icon next to the credential, and then scan the YubiKey a second time when prompted. Touch credentials work this way over NFC because NFC does not provide enough power for the capacitive touch sensor on the YubiKey to function.
  4. Enter the code on the website and click Sign In (or similar). Tip: In Yubico Authenticator for Desktop, you can double-click the code, and then paste it into the field for the authenticator code.

Troubleshooting and Additional Topics

Codes generated by Yubico Authenticator are wrong

Yubico Authenticator implements the OATH-TOTP standard, which specifies a standard for one-time passwords that are based on time. If Yubico Authenticator is generating codes that are being rejected as incorrect, the most likely cause is an incorrectly-set clock on whichever device is running Yubico Authenticator.

 

Password-protecting the YubiKey's OATH application

To further enhance the security of your YubiKey, consider adding a password to its OATH application. This will result in the password being required before codes can be generated with Yubico Authenticator. To add a password to the OATH application:

 

  • In Yubico Authenticator for desktop:
    • Click the triple-dot button to open the menu and expand the section Set password.
  • In Yubico Authenticator for iOS:
    • Tap the gear button to open the menu, and tap Set password.
  • In Yubico Authenticator for Android:
    • Scan or insert your YubiKey, tap the triple-dot button, then tap Change password.

Backing up accounts

While it isn't possible to back up accounts from the YubiKey itself, it is possible to back up the piece of information provided by each service provider, and then use that to program the same account (or credential) onto multiple YubiKeys.

In order to do this, when first setting up a service with Yubico Authenticator, take a screenshot of the QR code (or make a copy of the secret key) provided by the service. After setting up your primary YubiKey using this QR code or secret key, re-use it to program the same credential into each spare YubiKey.

 

Reviewing logs (Flutter-based versions only)

For Flutter-based Yubico Authenticator (all versions except iOS), if the above guidance does not resolve your issue, you may find additional help by capturing a log.

  1. Navigate to the home section of the Yubico Authenticator.
  2. Tap on the top right to open the options menu.
    Screenshot 2024-07-09 at 10.52.20 AM.png
  3. Select Help and about to open the about menu.
    Screenshot 2024-07-09 at 10.55.40 AM.png
  4. Change the log level to DEBUG and reproduce your issue. Once the issue is reproduced return to this menu and click Copy log
    Screenshot 2024-07-09 at 10.57.08 AM.png

The log levels are ERROR, WARNING, INFO, DEBUG, and TRAFFIC, in order of increasing verbosity. The default level is INFO, which is what the app is started with. In general what gets logged is:

  • ERROR - Any error that occurs. Usually when an action cannot be performed.
  • WARNING - Something failed, but the app is able to recover and complete the action, or the failure doesn't impact the action.
  • INFO - Usually what the app is doing without specific details. Like a credential was added/removed/renamed, etc.
  • DEBUG - More detailed information than INFO, also containing specifics about the action performed. This can include things like the name of the added account, along with more information on how something was done. This information should be useful for figuring out specifically what happened in the case of a failure. While some info at this level might be considered sensitive, it won't have actual secret keys.
  • TRAFFIC - Even more detailed info, including ALL raw traffic to/from the YubiKey. This includes the actual SECRETS when adding a credential, PIN codes that are being set, etc.

Note that the DEBUG and TRAFFIC levels will show a red warning in the app when active, and you should generally refrain from sharing logs of DEBUG and TRAFFIC levels with others, as they may contain sensitive information.

 

Once the log level has been set and the issue has been reproduced, you can copy the log to the clipboard via Menu > Help and about > Copy log, and then paste it into a text editor, etc. for review.