---
title: Managing two-factor authentication
summary: null
url: >-
  https://www.fastly.com/documentation/guides/organizations-and-accounts/personal-user-profiles/managing-your-two-factor-authentication
---

> **IMPORTANT:** This guide only applies to customers with Fastly accounts or with Signal Sciences accounts linked to Fastly accounts. If you only have a Signal Sciences account, check out our guide to [enabling and disabling two-factor authentication](https://www.fastly.com/documentation/guides/next-gen-waf/account-info/enabling-and-disabling-two-factor-authentication) instead.

Fastly supports two-factor authentication, a two-step verification system, for logging in to the control panel and other linked Fastly assets (for example, the Fastly support portal). In a two-factor authentication security process, users provide two means of identifying themselves to the system, typically by providing the system with something they know (for example, their login ID and password combination) and something they have (such as an authentication code).

Depending on whether or not your organization has enabled company-wide two-factor authentication, you may be able to enable and disable two-factor authentication for your personal account. You can also recover access to your account if you lose your mobile device.

## Before you begin

Keep the following things mind:

- **You'll need to enter an authentication code regularly.** Once two-factor authentication has been enabled for a Fastly account, an authentication code will be requested upon login at least every 14 days for each computer and browser used to access the Fastly control panel or a linked Fastly asset.
- **A mobile device is required.** Using this security feature with a Fastly account requires a mobile device capable of scanning a barcode or QR code using a downloadable authenticator application. We recommend either [Google Authenticator](https://support.google.com/accounts/answer/1066447?hl=en) or [Duo Mobile](https://guide.duo.com/third-party-accounts).
- **There are special requirements for using this feature with API tokens generated for the Fastly control panel.** Check out the [API token documentation](https://www.fastly.com/documentation/reference/api/auth-tokens/) for more information.

## Enabling two-factor authentication for your account

Follow these steps to enable two-factor authentication for your account.

1.   Log in to the [Fastly control panel](https://manage.fastly.com).

2. Go to **Account** > [**Profile & security**](https://accounts.fastly.com/profile).

3. Click [**Two-factor authentication**](http://accounts.fastly.com/profile/security).

4. Click **Two-factor authentication**.

5. Click **Continue** and then reauthenticate your login credentials.

   ![the 2fa setup page with scannable QR code](/img/account-security-2fa-scan-qr-code-universal-login.png)

6. Launch the authenticator application installed on your mobile device and scan the QR code on the setup page. A time-based authentication code appears on your mobile device. If a browser link appears, click it to save the code. When you do, the words `Secret saved` appear briefly.

7. In the **One-time code** field in the setup page, enter the time-based authentication code displayed by your mobile device.

   > **HINT:** **Google Authenticator Users:** A common time syncing issue may cause your authenticator codes to fail. You can correct this using [Google's instructions](https://support.google.com/accounts/answer/185834?hl=en#sync).

8. In the **Device name** field, enter a name to help you identify your device and then click **Continue**.

9. Click **Finish setup**. Two-factor authentication will be enabled for the next time you [log in](https://www.fastly.com/documentation/guides/organizations-and-accounts/personal-user-profiles/logging-in-and-switching-between-fastly-accounts).

10. [Generate recovery codes](https://www.fastly.com/documentation/guides/organizations-and-accounts/personal-user-profiles/managing-your-two-factor-authentication#generating-recovery-codes-for-your-account) for your account in case of emergency.

Once you enable two-factor authentication for your account, any other open sessions in other browser windows will require reauthentication in those windows using an authentication code generated by the authenticator application installed on your mobile device (in addition to your email and password). Future logins will also require an authentication code. By default, the system requires you to authenticate your login using an authentication code at least every two weeks for each computer and browser you use to access the Fastly control panel or linked Fastly asset.

## Generating recovery codes for your account

If you're ever unable to access your mobile device, recovery codes can be used to log in when your account has two-factor authentication enabled. Each of these recovery codes can only be used once, but you can regenerate a new set at any time and any previously generated codes that are still unused will be invalidated.

To generate recovery codes, follow these steps.

1.   Log in to the [Fastly control panel](https://manage.fastly.com).

2. Go to **Account** > [**Profile & security**](https://accounts.fastly.com/profile).

3. Click **Two-factor authentication**.

4. Click **Generate new recovery codes**.

5. Click **Download recovery codes** and then save them in a secure location.

   > **IMPORTANT:** Be sure to store a copy of your recovery codes in a safe place in the same order they appear on the screen. You'll need to use them in the displayed order if you [lose access to your mobile device](https://www.fastly.com/documentation/guides/organizations-and-accounts/personal-user-profiles/managing-your-two-factor-authentication#what-to-do-if-you-lose-your-mobile-device) and need to use a recovery code in place of the authentication application to access your account.

6. Click **I've saved my recovery codes**.

## Disabling two-factor authentication for your account

> **IMPORTANT:** If your organization has enabled [company-wide two-factor authentication](https://www.fastly.com/documentation/guides/organizations-and-accounts/account-members-and-permissions/administering-two-factor-authentication#enabling-company-wide-two-factor-authentication), you cannot disable two-factor authentication for your account.

Once two-factor authentication is enabled for your account, you can disable it at any time by following these steps.

1.   Log in to the [Fastly control panel](https://manage.fastly.com).

2. Go to **Account** > [**Profile & security**](https://accounts.fastly.com/profile).
3. Click **Two-factor authentication**.
4. Click **Disable two-factor authentication**.
5. In the **Your authentication code** field, enter the time-based authentication code displayed in the authenticator application on your mobile device, then click **Disable**.

> **HINT:** If you have lost your mobile device, you can enter a recovery code in the **Authentication Code** field. For more information, check out the section on [what to do if you lose your mobile device](https://www.fastly.com/documentation/guides/organizations-and-accounts/personal-user-profiles/managing-your-two-factor-authentication#what-to-do-if-you-lose-your-mobile-device). If your organization has enabled company-wide two-factor authentication, you can also contact a superuser in your organization and ask them to [reset it](https://www.fastly.com/documentation/guides/organizations-and-accounts/account-members-and-permissions/administering-two-factor-authentication#resetting-a-users-two-factor-authentication) for you.

## What to do if you lose your mobile device

If you lose your mobile device after enabling two-factor authentication, use a recovery code to log in to your Fastly account.

> **IMPORTANT:** You must use the recovery codes for your account in the order they were supplied to you. If you don't, an invalid recovery code error will appear and you'll be asked to enter the next valid code in your list.

You can continue to use recovery codes to log in until you get your mobile device back. Recovery codes can only be used once, however, so remember to regenerate a new list of codes as needed to avoid running out before you recover your mobile device.

If you do not believe you will be able to recover your lost mobile device and you still have at least two recovery codes left, you can log in with one recovery code and disable two-factor authentication with a second code. Once two-factor authentication is disabled, you can re-enable it with a new mobile device at a later time and regenerate a new set of codes.

Locked out of your account? Check out our article on [what you can do about it](https://www.fastly.com/documentation/guides/organizations-and-accounts/personal-user-profiles/troubleshooting-your-login).
