Account and security
Two-factor authentication
Time-based one-time codes from an authenticator app, set up on the web dashboard, with eight recovery codes; how the iOS app and the API behave once it is on.
Updated · 2 min read
Two-factor authentication (2FA) adds a six-digit code from an authenticator app to every password sign-in.
Setting it up (web)
- Settings, Profile, Security & access, Two-factor authentication, Turn on. (
POST /api/auth/2fa/setupreturns the secret and a QR code.) - Scan the QR code with an authenticator app (any TOTP app: 1Password, Google Authenticator, Authy and others).
- Enter the current code to confirm (
POST /api/auth/2fa/verify-setup). - Save the eight recovery codes shown once. Each works one time, in place of a code, if you lose the device.
Setup is web-only. In the app, Account, Settings, Web console opens the web dashboard with your session for it.
Signing in with it on
- Web: password, then the code.
- iOS: password, then a code sheet. A recovery code works in the same field.
- API:
POST /api/auth/loginreturns a 2FA challenge;POST /api/auth/2fa/verifycompletes it. API keys are not affected: a key is its own credential. - Sign in with Apple: Apple's own two-factor stands in; DomainGuard's TOTP applies to password sign-ins.
Status and disabling
GET /api/auth/2fa/status reports whether it is on. Disable from Settings, Profile, Security & access with a current code (POST /api/auth/2fa/disable). The secret is stored encrypted at rest.
Lost the device
Use a recovery code to sign in, then disable and re-enable 2FA to get a new secret and fresh codes. Out of recovery codes: Ask for help from the locked-out sign-in screen; identity is verified before anything is reset.
Common questions
The code is refused. Check the phone's clock is set automatically; TOTP is time-based. A code is accepted in its 30-second window and one window either side, and each code works only once.
Does 2FA lock the API? No. Keys bypass it, which is why keys are scoped and can expire.
Does the QR handoff bypass it? The handoff is created from an already-authenticated web session, so the second factor was already satisfied there.
Keep reading
Related articles
- Signing inSign in with Apple first, email with show/hide password and reset, the QR code from the web dashboard, Face ID for a saved session, and the two-factor code.iOS app ·Updated
- Sign in with AppleSign in with Apple on the iOS app and on the website, what happens with a hidden relay email, linking Apple to an existing email account, and revocation.Account and security ·Updated
- Deleting your accountThe request-and-confirm flow on the web, the type-DELETE flow in the app, what is erased, and why an Apple subscription has to be cancelled separately.Account and security ·Updated
