Yubikey WebAuthn 2FA User Guide (2024)

Your YubiKey is used for two factor authentication (2FA) using the WebAuthn protocol. Several other protocols are supported by YubiKeys (OTP, U2F, etc.) however they are not used at GitLab. This guide provides a getting started to use your YubiKey for WebAuthn.

Onboarding Guide

Congratulations on receiving your YubiKey(s) that you will use for two factor authentication (2FA). If you’re familiar with using Touch ID, a YubiKey works almost the same way, however you do not need to register your fingerprint.

See How It Works to learn more.

Please repeat the steps below for each of the keys. You can perform the steps in parallel with both keys plugged in when configuring 2FA in each application.

  1. Insert your YubiKey(s) into an available USB port on your laptop, monitor, or docking station.

  2. Open a text editor a empty browser window and tap on the YubiKey’s gold contact. You should see a string get populated. cccccbchbneclfhiefkkdgfkiuvukginvnhlefdcbuuc. Your YubiKey is working!

  3. Follow the instructions in the guides for each of our applications to configure your YubiKey as a 2FA authenticator. If you have multiple accounts, repeat the steps for each account.

    • Okta Guide
    • Google Guide
    • GitLab Guide
  4. You’re all set!

Day-to-Day Usage

Using YubiKey for 2FA

When prompted to sign into a configuration application in the future, you may see a QR code or ask to use your passkey or Touch ID. Even if it says Passkey or Touch ID, touching your YubiKey still works. You simply need to touch your key, or click on the USB thumb drive icon in the prompt and then touch your key.

Yubikey WebAuthn 2FA User Guide (1)

Adding New Applications

When prompted to enable 2FA in the future, simply tap your key when prompted with a QR code, to enable Touch ID, or to add a Passkey.

If the YubiKey is not working for that application, try using Touch ID, and then fall back to using 1Password to scan the QR code to save the one time password (OTP) to the appropriate record in your 1Password vault.

Yubikey WebAuthn 2FA User Guide (2)

Yubikey WebAuthn 2FA User Guide (3)

Yubikey WebAuthn 2FA User Guide (4)

Using YubiKey on Mobile Devices

If you have configured an NFC key, see the Android and iOS guides for instructions on signing in with your YubiKey to approved mobile applications that do not use FaceID or biometrics.

Leaving YubiKey Inserted or Removing

A frequently asked question is whether you should leave your YubiKey plugged in all the time?

This is a personal preference and you can use your own judgement.

Leave a Nano Key Plugged In

If it’s your first time using a YubiKey and you’re used to Touch ID, we suggest using the Nano key and leaving it plugged in. If you’re working from home, you can leave it plugged in. If you travel to a coffee shop (low risk area), it’s still fine.

If you are going to do a long trip, vacation, or anytime you head to the airport, you should unplug your YubiKey and keep it in a separate place from your laptop.

A Nano key is small and easy to lose. If you have a nano key, we recommend leaving it plugged in or stored in a safe place. Do not put it in your pocket or laptop bag without having a specific place to keep it. A life hack is that if you have wireless headphones with a USB-C port, you can plug it into the bottom of those for travel storage.

Separation with NFC Keys

Many engineering and security conscious people prefer to have it separated (ex. use an NFC key that is on a keyring), while others will leave it plugged in all the time (ex. in their monitor or docking station).

An NFC key is easy to break off when moving a laptop around, so please be sure to unplug the key before picking up your laptop and moving to a different seat.

You can unplug it and plug it back in at any time without “disconnecting/ejecting it” (like a thumb drive).

How It Works

Each YubiKey is a piece of black plastic with an internal circuit board that exposes gold contacts (slivers of exposed metal). It has a USB-A or USB-C plug that you insert into your laptop or the side of your monitor or docking station.

You can insert it into any port. It is recommended to choose one that you do not use regularly for a power cord, monitor cord, or docking station cable.

Yubikey WebAuthn 2FA User Guide (5)

Yubikey WebAuthn 2FA User Guide (6)

Yubikey WebAuthn 2FA User Guide (7)

WebAuthn Authentication

When you are prompted for your passkey/2FA/Touch ID, you simply rest your finger on the gold contacts for a split second (similar to touching the fingerprint reader of TouchID sensor), and the YubiKey activates itself and sends a cryptographic string (as if you typed it) that is recognized by the 2FA technology (FIDO2/WebAuthn) on your computer and the server side. Each press generates a unique string, so the string you see below is useless after a few seconds.

cccccbchbneclfhiefkkdgfkiuvukginvnhlefdcbuuc

Simpler explanation? The oversimplified analogy is that it’s similar in concept to SSH key public and private key pairs that are used when you authenticate via SSH (or Git).

Yubikey WebAuthn 2FA User Guide (8)

Yubikey WebAuthn 2FA User Guide (9)

Other Authentication Methods

A YubiKey supports a wide range of authntication methods including FIDO2/WebAuthn (hardware bound passkey), FIDO U2F, Yubico OTP, OATH-TOTP, OATH-HOTP, Smart card (PIV) and OpenPGP.

At GitLab, we only use FIDO2/WebAuthn. This works natively on your laptop without installing any of the YubiKey software. Simply insert your key into a USB port and touch the gold contacts when prompted to set up 2FA or a Passkey on any website.

From an IT perspective, we simply want users to insert their YubiKey (out of the box) and touch their key (to use FIDO2/WebAuthn) instead of using Touch ID when authenticating with web applications. All additional usage is at each engineer’s discretion, unless it is included in your team’s (ex. Site Reliability Engineer) onboarding instructions.

For advanced power users at your discretion (not mandated or supported by IT), you are welcome to install YubiKey Manager, optionally set a pin code on your YubiKey, use your YubiKey for SSH or GPG key storage, or configure slot 1 (short touch) and slot 2 (long touch).

Primary and Secondary Keys

A YubiKey is similar to a car key. If you lose your car key, you can’t start your car. With a secondary/backup car key, you can still get to your appointment on time.

If you lose your YubiKey, it’s like losing the car key that allows you to sign in to the web application. With a second YubiKey, both keys are enrolled as 2FA authenticators and although you may only use the secondary/backup one occasionally, it provides assurance that you can still sign in. As a remote company, it’s not possible to walk down the hall to the IT Helpdesk to get a new one and it’s not logistically feasible to ship you a YubiKey overnight.

Unlike a software authenticator that can be reset by IT and re-enrolled, we can’t get you into systems that use YubiKey authentication unless we add you to a bypass 2FA policy that lowers our security posture. We will do this when needed, and during our early deployment of YubiKeys until we can get everyone a secondary/backup key.

YubiKey User Guide for Android Mobile Devices

This guide shows you how to use your YubiKey USB-C or NFC key for 2FA when signing into web applications on your Android device.

YubiKey User Guide for Apple iOS Mobile Devices

This guide shows you how to use your YubiKey USB-C or NFC key for 2FA when signing into web applications on your iPhone or iPad.

YubiKey User Guide for GitLab.com User Accounts

This guide shows you how to add your YubiKey as a 2FA authenticator on your GitLab.com SaaS or self-managed instance account.

YubiKey User Guide for Google

This guide shows you how to add your YubiKey as a 2FA authenticator on your Google account.

YubiKey User Guide for Okta

This guide shows you how to add your YubiKey as a 2FA authenticator on your Okta account.

Last modified March 8, 2024: Fix Yubikey guide typos (ed67737a)

View page source- Edit this page-please contribute.Yubikey WebAuthn 2FA User Guide (10)

Yubikey WebAuthn 2FA User Guide (2024)

FAQs

How to use YubiKey for 2FA? ›

Setting Up Your YubiKey in Yubico Authenticator 6.0+ for Desktop
  1. Enable two-factor authentication for your service. ...
  2. Select the option to use a mobile app, or Google Authenticator. ...
  3. Open Yubico Authenticator for Desktop and plug in your YubiKey.
  4. Select the Yubikey picture on the top right.
  5. Select Add Account.
May 12, 2020

How do I use my YubiKey for the first time? ›

If you're using a YubiKey (not another hardware authenticator), here's what you need to do:
  1. Plug in your YubiKey.
  2. Go to Yubico.com/setup and click your device.
  3. In the Compatible accounts and services section, browse the list of supported apps and services, and select the ones you want to secure with your device.
Nov 27, 2023

What is the difference between WebAuthn and Authenticator? ›

An Authenticator is a device that creates and stores user credentials. In a password-based authentication, the credentials (the passwords) are stored in the user's brain. In a WebAuthn scenario, the credentials are stored on a device.

How do I use WebAuthn? ›

Basic Process
  1. Step 1: User goes to browser to initiate login.
  2. Step 2: Web server creates a unique challenge that is sent to the authenticator.
  3. Step 3: Authenticator receives challenge with domain name of challenge.
  4. Step 4: Authenticator receives biometric consent from user.

Can I use YubiKey instead of authenticator app? ›

YubiKey is a physical security key which enables strong multi-factor authentication into a variety of systems. Enterprise Technology & Services recommends YubiKeys in situations where phone (either phone call or text message) or authenticator app is not an option.

How do I use YubiKey instead of Google Authenticator? ›

Simple Setup

Easily register your YubiKey with Google. Go to Account settings, select Sign in & Security, select 2-Step Verification, and Add Security Key.

Should I leave my YubiKey plugged in all the time? ›

If it's your first time using a YubiKey and you're used to Touch ID, we suggest using the Nano key and leaving it plugged in. If you're working from home, you can leave it plugged in.

Does YubiKey require an app? ›

The versatile YubiKey requires no software installation or battery so just plug it into a USB port and touch the button, or tap-n-go using NFC for secure authentication.

How do I manually enter my YubiKey code? ›

To manually add the secret key, select Add account manually, then enter the credential name, and type the secret key that you previously saved as a backup.

Why use WebAuthn? ›

WebAuthn removes the need for an application or user store to save off private, valuable data such as a hashed password. Instead, the application stores a public key. The corresponding private key is held securely by each user's authenticator.

What is the difference between YubiKey and WebAuthn? ›

YubiKey and WebAuthn are two different technologies that provide strong authentication for online services. YubiKey is a hardware-based authentication device produced by Yubico, while WebAuthn is a standard for web authentication developed by the World Wide Web Consortium (W3C).

Where can I use WebAuthn? ›

HTML attribute: autocomplete: webauthn value
  • Chrome. 4 - 107 supported. 108 - 123 Supported. ...
  • Edge * 12 - 107 supported. 108 - 123 Supported. ...
  • Safari. 3.1 - 17.3 supported. ...
  • Firefox. 2 - 124 supported. ...
  • Opera. 10 - 93 supported. ...
  • IE ⚠️ * 6 - 10 supported. ...
  • Chrome for Android. 124 Supported.
  • Safari on iOS * 3.2 - 17.3 supported.

Is FIDO2 and WebAuthn the same? ›

FIDO2 is a standard that is built on the WebAuthn and CTAP standards, where they are able to work together to create strong authentication experiences. Below is a diagram that provides an overview of how FIDO2 creates the concert of WebAuthn and CTAP to perform authentication ceremonies.

Is passkey the same as WebAuthn? ›

The most important difference is that passkeys can be used as first-factor authentication whereas WebAuthn MFA can only be used as a second-factor after user registration with a password.

Is WebAuthn passwordless? ›

WebAuthn is part of the FIDO2 framework, which is a set of technologies that enable passwordless authentication between servers, browsers, and authenticators.

Is YubiKey two-factor authentication? ›

Fast and Simple Two-Factor Authentication | YubiKey | Yubico.

How do I add YubiKey to my authenticator app? ›

Open the Yubico Authenticator, hold the YubiKey up to the NFC adapter at the request of the app and touch the metal part of the key. Click the add account icon in the top right corner of the app. Enter the secret key manually or scan the QR code to add a new account to the app and sync it with the server.

How does YubiKey MFA work? ›

Logging into a service with a YubiKey requires the user to touch or tap the key to authenticate. The touch sensor on the YubiKey verifies that the user is a real human and that the authentication is done with real intent. This prevents remote attacks that can easily bypass software-based MFA.

How to use a 2FA security key? ›

  1. Open a compatible browser like Chrome.
  2. Sign in to your Google Account. Your device will detect that your account has a security key.
  3. Connect your key to the USB port in your device. You may need a USB adapter.
  4. If you see a message from "Google Play services," tap OK. If not, move on to step 5.
  5. Turn on your key:

Top Articles
Latest Posts
Article information

Author: Msgr. Refugio Daniel

Last Updated:

Views: 5981

Rating: 4.3 / 5 (54 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Msgr. Refugio Daniel

Birthday: 1999-09-15

Address: 8416 Beatty Center, Derekfort, VA 72092-0500

Phone: +6838967160603

Job: Mining Executive

Hobby: Woodworking, Knitting, Fishing, Coffee roasting, Kayaking, Horseback riding, Kite flying

Introduction: My name is Msgr. Refugio Daniel, I am a fine, precious, encouraging, calm, glamorous, vivacious, friendly person who loves writing and wants to share my knowledge and understanding with you.