Enroll users with YubiKeys (HOTP)

Help users activate and use a YubiKey hardware token as a second factor of authentication (MFA) with UserLock.

Published May 1, 2024

Introduction

YubiKeys are programmable hardware tokens by Yubico.

UserLock supports HOTP-based YubiKeys, allowing MFA without any client-side setup.
At logon, users simply touch the YubiKey — it automatically enters the one-time password, minimizing input errors.

This guide explains how to help end users enroll a YubiKey as their second factor of authentication with UserLock.
It covers the setup process, usage at login, and troubleshooting basics.

Note

🚩 Before following this guide:
We recommend reading How to implement MFA for general recommendations, communication tips, and preparation steps to ensure a smooth rollout.

Requirements

  • A YubiKey model with HOTP support (for example: YubiKey 5 NFC or any YubiKey 5 Series.).

  • The YubiKey must be plugged into the USB port of the user’s computer.

  • Enrollment must be performed in a local desktop session (not via RDP), unless USB redirection is supported.

  • After enrollment, RDP logins with the YubiKey plugged into the client computer are supported.

Note
  • If users already use YubiKeys for other purposes (e.g., web logins), ensure a free slot is available for MFA with UserLock.

  • YubiKeys can store multiple credentials in two programmable slots (short touch = slot 1, long touch = slot 2).

Step 1. Enable MFA for the user

Before enrolling, make sure that MFA is enabled for the user account in UserLock.

Note

Step 2. Enroll the Yubikey

When MFA is enabled for a user account, follow these steps to configure YubiKey:

  1. Plug the YubiKey into the computer’s USB port. Do not connect via RDP for the first enrollment.

  2. Log in to Windows.

  3. The UserLock Desktop Agent detects the YubiKey and asks whether it should be configured for MFA. Click Yes (if the user declines, TOTP setup is offered instead):

  4. Select a YubiKey slot, then click Link YubiKey:

    How UserLock MFA detects YubiKey
  5. The Desktop Agent programs the YubiKey automatically (the MFA secret is never displayed). Click on Success button to confirm:

  6. Touch the YubiKey (short or long press, depending on slot). The 6-digit code is entered automatically.

  7. Enrollment is complete, and the user is logged in.

Step 3. Authenticate

Once enrolled, MFA with YubiKey works as follows:

  1. Plug the YubiKey into the computer’s USB port (local or RDP client machine).

  2. Log in.

  3. When prompted, touch the YubiKey.

  4. The 6-digit code is entered automatically.

  5. Click Verify and continue to complete login.

Advanced topics

Using YubiKey with RDP

  • Enrollment must be done on a local desktop session.

  • After enrollment, users can log in through RDP with the YubiKey connected to their client computer.

  • If USB redirection is enabled, remote enrollment may be possible.

Lost or unavailable YubiKey

If a YubiKey is lost or unavailable, administrators can help using the optional Ask for help feature (disabled by default). Possible actions:

  • Reset the MFA key.

  • Temporarily disable MFA.

  • Assist the user in activating a new YubiKey.

Migrating from TOTP to YubiKey HOTP

If a user was previously using TOTP and now switches to HOTP:

  • Reset the MFA key.

  • Re-enroll using the First-time enrollment procedure.

Limitations

  • Enrollment must be done locally (desktop session only).

  • Tokens cannot be enrolled via RDP, IIS, SaaS, or VPN sessions. After setup, they can be used for these connections.

  • Virtual machines: YubiKey works with VirtualBox (setup + authentication). With Hyper-V, authentication works but setup may fail.

  • HOTP desynchronization: If a YubiKey is used for many offline logins, its counter may desynchronize with UserLock.

    • By default, UserLock tolerates a drift of 6 codes.

    • This can be adjusted via the advanced parameter MaxHotpCodeCount.

About YubiKeys

YubiKeys are programmable tokens created by Yubico.
They support multiple authentication methods including HOTP, TOTP, passwordless authentication, and smartcard logon.