Skip to main content

Set up two-factor authentication

Two-factor authentication puts a second step between your password and your account. Once it's on, signing in needs a short code as well as your password — and so do the actions that could hand someone else the keys, like creating an access token or revoking an app.

A password can be guessed, reused, phished, or turn up in someone else's data breach. A second factor means none of that is enough on its own.

Before you begin

  • This is a personal setting. You turn it on for your login; it doesn't affect anyone else, and you don't need an administrator to do it.
  • Have somewhere to put your recovery codes before you start — a password manager, or paper somewhere safe. You'll be shown them once.
  • If you're going to use an authenticator app, install it on your phone first.
  • The screenshots come from a demonstration account.

Where to find it

Go to Settings → Developer → Two-Factor Authentication.

The Two-Factor Authentication page showing the sign-in security card reading two-factor authentication is off, and a verification methods card listing Authenticator app and Email code

The Sign-in security card at the top always tells you where you stand. While it's off, it says so plainly: Your account is protected by your password alone.

Choose a method

Verification methods lists what you can verify with. You use one at a time.

MethodHow it worksWorth knowing
Authenticator appA 6-digit code from an app on your phone or password managerWorks with no signal and nothing to intercept, so it's the stronger of the two
Email codeA 6-digit code sent to your registered email address each time it's neededNothing to install, but only as secure as your email account

If you can use an authenticator app, use it. Emailed codes are a reasonable fallback when you can't.

Turn on the authenticator app

Any app that supports time-based codes works — 1Password, Authy, Google Authenticator, and others.

  1. Click Set up on the Authenticator app row.

    The verification methods card with a Set up button on the Authenticator app row and a Turn on button on the Email code row

  2. Scan the QR code with your authenticator app.

    The Set up an authenticator app dialog with numbered instructions, a QR code, a setup key with a copy button, and a verification code field

    Can't scan it? Copy the setup key shown beside the code and type it into your app by hand. The account and issuer underneath are what the entry will be called in your app, so you can tell it apart from the others.

  3. Your app starts showing a 6-digit code that changes every 30 seconds. Type the current one into Verification code.

    The same dialog with a six-digit verification code entered and the Turn on button now enabled

  4. Click Turn on.

    Entering the code is what proves the enrolment worked — that your app really can read codes from the secret it was given. Nothing about how you sign in changes until it does. If the code is rejected, the setup stays open so you can try the next one your app shows.

  5. Save the recovery codes you're given, tick I have saved these codes somewhere safe, and click Done. The next section explains what they're for.

The status card flips to Two-factor authentication is on, and the Authenticator app row is marked In use.

The Two-Factor Authentication page with two-factor authentication on, Authenticator app marked In use, a recovery codes card reading 10 of 10 remaining, and a turn off card

Two new cards appear with it: Recovery codes, and Turn off two-factor authentication.

Turn on email codes

If you'd rather have codes emailed, click Turn on on the Email code row. There's nothing to enrol, so it takes effect immediately — you'll go straight to the recovery codes. The address codes go to is the one shown on the row.

Save your recovery codes

Recovery codes are how you get back in when you can't reach your verification method — a lost phone, a wiped authenticator app, an email account you can't open.

The recovery codes dialog warning that this is the only time the codes will be shown, with ten codes, Copy all and Download buttons, and a checkbox confirming they have been saved

You get 10 codes, and they're shown once. Use Copy all to put them in a password manager, or Download for a text file you can print. The checkbox is there to make you stop and do it — Done stays disabled until you tick it, because there's no second showing.

Each code works once. Using one doesn't turn two-factor authentication off; it only spends that code.

The codes avoid characters that are easy to misread — no 0 against O, no 1 against I — because sooner or later someone reads one off a printout. They're also not case-sensitive when you type one in.

Check how many you have left

The Recovery codes card tracks what's left and when the set was generated.

The recovery codes card reading 10 of 10 remaining with a Generate new codes button

When you're down to 3 or fewer, a warning appears telling you to generate a new set before you get locked out.

Generate a new set

Do this if you've used several, if you think the list has been seen by someone else, or if you've lost it.

  1. Click Generate new codes.

  2. Confirm.

    The Generate new recovery codes dialog explaining the remaining codes stop working straight away and new ones take their place

  3. Save the new set the same way.

The old codes stop working the moment the new ones are issued — there's no overlap. Have somewhere to put them before you start.

Signing in from now on

After your password, you'll see the Two-step verification step.

With an authenticator app, it asks for the code your app is showing:

The two-step verification sign-in screen telling you to open your authenticator app, with a six-digit code entry and a Verify button

With emailed codes, it tells you where the code was sent and offers Resend code if it doesn't arrive — you can send another after a 30-second wait. An emailed code stays valid for an hour.

The same screen for emailed codes, confirming a six-digit code was sent to the account's email address, with a Resend code link

If you can't reach either, click Use a recovery code instead and enter one of the codes you saved.

The sign-in screen switched to recovery code entry, with a field formatted XXXXX-XXXXX

A recovery code works here whichever method you normally use — a fallback that only worked on the screen where you still had your phone wouldn't be much of a fallback. Back to login returns you to the password step.

Verifying before sensitive actions

Signing in isn't the only place a code is asked for. Once two-factor authentication is on, so are the actions that could be used to take the account over — creating access tokens, revoking connected apps, and changing these two-factor settings themselves.

Verifying covers you for 10 minutes, so a run of related changes doesn't mean a code each time. After that, the next sensitive action asks again. A recovery code is accepted here too.

This is why an attacker with a stolen session still can't quietly disable your second factor: turning it off is itself gated behind it.

Switch to the other method

  1. Click Use this instead on the method you want.

  2. Read the confirmation and click Switch.

    The Switch to email code dialog warning that the authenticator app stops being the verification method and that remaining recovery codes stop working

  3. Save the new recovery codes you're issued.

The verification methods card after switching, with Email code marked In use and the Authenticator app row back to a Set up button

Two things happen that are easy to miss. The method you switched away from is not kept on file — going back to an authenticator app later means scanning a fresh QR code, because the old secret is gone. And your existing recovery codes stop working; a new set is issued and shown once.

Turn it off

Turning two-factor authentication off leaves your password as the only thing protecting the account, and destroys your recovery codes. There's rarely a good reason for it.

  1. Click Turn off on the Turn off two-factor authentication card.

  2. Confirm.

    The Turn off two-factor authentication dialog warning that only a password will be needed and recovery codes will stop working

If you're turning it off because you've lost your phone, switch methods or generate new recovery codes instead — both leave the protection in place.

Troubleshooting

What you seeWhat it means
That code did not match. during setupThe code expired while you typed it, or your phone's clock is out. Wait for the next code and try that one. If it keeps failing, turn on automatic time on your phone
The code your app shows is rejected at sign-inSame causes. Codes last about 30 seconds, and a small clock difference is tolerated — a large one isn't
The same code won't work twiceDeliberate. Once a code has been accepted it can't be used again, so anyone who saw it over your shoulder can't reuse it
The emailed code hasn't arrivedCheck spam, then use Resend code. If email is the problem, sign in with a recovery code and switch to an authenticator app
You're out of recovery codesSign in with your usual method and generate a new set straight away
No phone and no recovery codesNobody can re-display your codes — they're stored one-way. Contact your administrator to get two-factor authentication cleared from the account
You're asked for a code again a few minutes laterVerification lasts 10 minutes. A longer session of changes will ask a second time
You set up the authenticator app but the row says Set up againThe enrolment only completes when a code is accepted. Run through it again and finish with Turn on

Next steps

Last verified: