# Set up two-factor sign-in codes with KeySigner

[Read this guide on KeySigner](https://keysigner.io/integrations/guides/set-up-a-time-based-sign-in-code/)

Add a time-based code for a test GitHub, GitLab, Cloudflare or Bitwarden account. Verify the code at setup and again when you sign in.

## Before you start

**KeySigner on iPhone or Mac with Sign-in codes**

- Use a disposable GitHub.com personal account. In Settings → Password and authentication, enable two-factor authentication and open the setup QR code. Save the recovery codes before finishing.
- Use a disposable GitLab account with a verified email. Open Edit profile → Access → Password and authentication, then register a one-time password authenticator. Save the recovery codes GitLab gives you.
- Use a disposable Cloudflare dashboard profile. In Profile → Authentication, open Two-Factor Authentication, then add Mobile App Authentication. Have your Cloudflare password available and save the backup codes.
- Use a disposable Bitwarden web vault. In Settings → Security → Two-step login, open Authenticator App settings. Have your master password available and save the recovery code outside this vault.

## Data and access

- **Shared or checked**. The service supplies a code setup secret to the test user. KeySigner holds the enrollment and generates a short code the user enters back in that service.
- **Check separately**. Keep the provider’s recovery codes available independently and check which existing sessions, passkeys and API tokens remain.

## 1. Open the setup QR code

Use the account settings above to open authenticator setup. Keep this browser session open while you test. The QR code contains the secret used to create sign-in codes. Keep it off chat, email and shared storage.

**Check.** The provider displays an authenticator setup code for the exact test account, and the original session is still active.

## 2. Add the account in KeySigner

Open Accounts, then Add (+) and Sign-in codes and backup. Unlock Sign-in codes, choose Add account and select Scan QR code. Choose Review account, check the issuer, account and time-based type, then choose Confirm and add.

![KeySigner’s Add account screen offers Scan QR code, Choose QR image and a setup link field.](https://keysigner.io/integrations/guides/set-up-a-time-based-sign-in-code/keysigner-add-account.png)

Add account in KeySigner for Mac before scanning a test QR code.

**Check.** The saved test entry shows the issuer and account you just reviewed.

## 3. Verify the code in the service

Choose Show code next to the test account. If prompted, choose a personal signing rule and enable signer protection. Keep the signers your rule requires available and complete KeySigner approval. Enter the current code in the service’s setup form. Finish enabling the authenticator and save the provider’s recovery codes somewhere you can reach independently of KeySigner and the test account.

**Check.** The service confirms the authenticator is enabled. You can reach the provider’s recovery material without the test account or KeySigner.

## 4. Try a fresh sign-in

With your original session still open, sign in using a separate private browser window. When asked for the authenticator code, approve a fresh code in KeySigner and enter it before it expires.

**Check.** The private window opens the intended account after it accepts the new code.

## Check your result

The service accepts the first code during setup and a fresh code at sign-in. Confirm you can reach the provider’s recovery codes without opening KeySigner or signing in to the test account. The service checks the code. KeySigner checks your rule before showing it.

[How to verify your setup](https://keysigner.io/integrations/verify-a-setup/)

## If you get stuck

### The service rejects a fresh code

Check that you chose the matching issuer and account in KeySigner. Turn on automatic date and time, then wait for the next code and try again. If setup was restarted and the service issued a new QR code, use the current QR code. Keep the original session and recovery method available while you check.

- [This setup key is too short. Ask the service for a key of at least 16 bytes.](https://keysigner.io/integrations/setup-messages/#setup-key-too-short)
- [This sign-in code is already in KeySigner. No second copy was added.](https://keysigner.io/integrations/setup-messages/#code-already-present)
- [The code expired. Generate another code.](https://keysigner.io/integrations/setup-messages/#code-expired)

## Tools in this guide

- [GitHub](https://keysigner.io/integrations/github/)
  - [Check commit and tag signature verification](https://docs.github.com/en/authentication/troubleshooting-commit-signature-verification/checking-your-commit-and-tag-signature-verification-status)
  - [Troubleshoot a commit signature](https://docs.github.com/en/authentication/troubleshooting-commit-signature-verification)
  - [Setup requirements](https://keysigner.io/integrations/setup-requirements/#github)
- [GitLab](https://keysigner.io/integrations/gitlab/)
  - [Review signed commits and verification](https://docs.gitlab.com/user/project/repository/signed_commits/)
  - [Setup requirements](https://keysigner.io/integrations/setup-requirements/#gitlab)
- [Cloudflare](https://keysigner.io/integrations/cloudflare/)
  - [Review account security](https://developers.cloudflare.com/fundamentals/account/account-security/)
  - [Set up access to the Cloudflare dashboard](https://developers.cloudflare.com/fundamentals/manage-members/dashboard-sso/)
  - [Setup requirements](https://keysigner.io/integrations/setup-requirements/#cloudflare)
- [Bitwarden](https://keysigner.io/integrations/bitwarden/)
  - [Set up passkey two-step login](https://bitwarden.com/help/setup-two-step-login-fido/)
  - [Recover access if you lose a two-step device](https://bitwarden.com/help/lost-two-step-device/)
  - [Setup requirements](https://keysigner.io/integrations/setup-requirements/#bitwarden)

## Setup instructions

- [Set up authenticator codes for GitHub](https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication#configuring-two-factor-authentication-using-a-totp-app)
- [Register an authenticator for GitLab](https://docs.gitlab.com/user/profile/account/two_factor_authentication/#register-an-otp-authenticator)
- [Set up authenticator codes for Cloudflare](https://developers.cloudflare.com/fundamentals/user-profiles/2fa/#configure-totp-mobile-application-authentication)
- [Set up authenticator two-step login for Bitwarden](https://bitwarden.com/help/setup-two-step-login-authenticator/)
- [Copy existing codes from Google Authenticator](https://keysigner.io/integrations/guides/import-codes-from-google-authenticator/)
- [Copy existing codes from a password manager](https://keysigner.io/integrations/guides/test-sign-in-code-import/)
- [Set up codes for PyPI, RubyGems or Docker Hub](https://keysigner.io/integrations/guides/set-up-package-registry-sign-in-codes/)
- [Set up codes for DigitalOcean, Akamai or Scaleway](https://keysigner.io/integrations/guides/set-up-cloud-dashboard-sign-in-codes/)
- [Test an authenticator app for an AWS IAM user](https://keysigner.io/integrations/guides/set-up-aws-iam-sign-in-codes/)
- [Set up a one-time code in Keycloak](https://keysigner.io/integrations/guides/set-up-a-keycloak-one-time-code/)
- [Check authenticator policies for managed accounts](https://keysigner.io/integrations/guides/check-authenticator-app-policies/)

[More guides for this task](https://keysigner.io/integrations/tasks/set-up-sign-in-codes/)
