- Google Authenticator
- Microsoft Authenticator
- Authy
- 1Password
- Any TOTP-compatible app
Enable 2FA on your account
Open your profile
Click your username or avatar in the top-right corner and select Profile, then switch to the Security tab.
Start setup
Click Enable Two-Factor Authentication. CoPilot generates a unique secret and displays a QR code.
Scan the QR code
Open your authenticator app and scan the QR code displayed on screen.
Can’t scan? Click Show manual entry key to reveal the secret as a text string. Enter it manually in your authenticator app.
Verify the code
Enter the 6-digit code currently shown in your authenticator app and click Verify & Enable.This confirms that your app is configured correctly and activates 2FA on your account.
Save your backup codes
After verification, CoPilot displays 8 one-time backup codes. These are your emergency access method if you lose your authenticator device.
- Click Copy all to copy the codes to your clipboard.
- Click Download .txt to save them as a text file.
- Store them somewhere safe (e.g. a password manager or a printed sheet in a secure location).
Log in with 2FA
Once 2FA is enabled, the login flow changes:- Enter your username and password as usual, then click Sign in.
- CoPilot recognizes that your account has 2FA enabled and shows a verification form.
- Open your authenticator app and enter the current 6-digit code, then click Verify.
- You are logged in.
SSO + 2FA: If you sign in via SSO (Azure, Google, or Cloudflare Access), you will still be prompted for the TOTP code after the identity provider authenticates you.
Use a backup code
If you cannot access your authenticator app (lost phone, new device, etc.), you can use one of your backup codes instead:- On the 2FA verification screen, click Use a backup code instead.
- Enter one of your saved backup codes (e.g.
ABCD1234EF). - Click Use backup code.
Regenerate backup codes
If you have used some of your backup codes or suspect they have been compromised:- Go to Profile → Security tab.
- Click Regenerate backup codes.
- Enter your current 6-digit TOTP code to confirm your identity.
- CoPilot generates 8 new backup codes. All previous codes are invalidated immediately.
- Save the new codes (copy or download).
Disable 2FA
- Go to Profile → Security tab.
- Click Disable 2FA.
- Confirm by entering your current TOTP code or a backup code.
- 2FA is removed from your account. Future logins will only require a password.
Brute-force protection
CoPilot enforces rate limiting on 2FA verification:- After 5 failed attempts, your account is locked out of 2FA verification for 15 minutes.
- This applies to both TOTP code entry and backup code entry.
- The lockout resets automatically after the timeout or on a successful verification.
FAQ
What happens if I lose my phone?
What happens if I lose my phone?
Use one of your backup codes to log in, then either regenerate new backup codes or disable 2FA and set it up again with your new device.
Can an admin disable 2FA for a user?
Can an admin disable 2FA for a user?
Currently, each user manages their own 2FA. If a user is locked out with no backup codes, an admin can reset their account through the database.
Does 2FA apply to API access?
Does 2FA apply to API access?
2FA is enforced during interactive login only. API tokens issued after a successful login (including 2FA) remain valid for their normal lifetime.
Which authenticator app should I use?
Which authenticator app should I use?
Any TOTP-compatible app works. Popular choices include Google Authenticator, Microsoft Authenticator, Authy, and 1Password. They are all interchangeable — pick whichever you prefer.
My codes are always rejected
My codes are always rejected
Check that your device clock is accurate. TOTP codes depend on precise time synchronization (within ±30 seconds). On mobile, enable automatic time in your device settings.
Environment variables (admin reference)
| Variable | Purpose | Default |
|---|---|---|
TOTP_ENCRYPTION_KEY | Fernet key used to encrypt TOTP secrets at rest in the database. | Derived from JWT_SECRET |
