You're viewing **Apigee Edge** documentation.  
[Go to the
**Apigee X** documentation](http://cloud.google.com/apigee/docs/api-platform/security/google-auth/overview). info

Two-factor authentication is an easy-to-use best practice that adds an additional layer of
protection for your Apigee account. To sign in to your account when two-factor auth is enabled,
you must supply your username and password and a 6-digit number. The number is randomly
generated, changes every 30 seconds and can only be used only one time to log in.

This topic explains how to set up and use two-factor auth.

> [!WARNING]
> **Warning:** If you publish your APIs using an [integrated portal](https://docs.apigee.com/api-platform/publish/developer-portal#integrated-portal) or [Drupal-based developer portal](https://docs.apigee.com/api-platform/publish/developer-portal#drupal), you must **use your identity provider to enforce two-factor authentication** by [enabling SAML for Apigee Edge](https://docs.apigee.com/api-platform/system-administration/enabling-saml-authentication-edge). Otherwise, the portal will not be able to [communicate with Edge](https://docs.apigee.com/api-platform/publish/drupal/communicating-between-developer-services-portal-and-edge).

To learn more about two-factor auth, check out the article
[Two-factor Authentication Using One-time Passwords](https://discuss.google.dev/t/two-factor-authentication-using-one-time-passwords/17126) on the Apigee Community.

## Setting up two-factor auth

You can enable two-factor auth for an entire organization or per individual.

### Enable two-factor auth for an entire organization

To enable two-factor auth for all users in an organization:

- Enable SAML as described at [Enable SAML](https://docs.apigee.com/api-platform/system-administration/enabling-saml-authentication-edge).
- After SAML is enabled, you can manage all authentication policies, such as password length, password strength, and two-factor auth, through your SAML identity provider.

### Enable two-factor auth individually

To enable two-factor auth, you must install [Google Authenticator](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en) on your iPhone or Android phone.

Enable two-factor auth in your Apigee account settings, as described below.

### Edge

To enable two-factor auth in your Apigee account settings using the Edge UI:

1. Sign in to <https://apigee.com/edge>.
2. Click your username to open the account menu and click **Edit Account** .  

   ![](https://docs.apigee.com/static/api-platform/images/two-factor-auth-2.png)  
3. Follow the instructions in the setup screen. You'll need access to the Google Authenticator app to complete the steps.
4. When you see the message Device added successfully, you're done!  

   ![](https://docs.apigee.com/static/api-platform/images/two-factor-auth-1.png)

### Classic Edge (Private Cloud)

> [!NOTE]
> **Note:** The Classic Edge UI is available with Edge for Private Cloud only.

To access the Users page using the Classic Edge UI:

1. Sign in to `http://ms-ip:9000` as an **organization administrator** , where <var translate="no">ms-ip</var> is the IP address or DNS name of the Management Server node.
2. Select ***username* \> User Settings**.
3. Click **Edit Account**.
4. Follow the instructions in the setup screen. You'll need access to the Google Authenticator app to complete the steps.
5. When you see the message Device added successfully, you're done!  

   ![](https://docs.apigee.com/static/api-platform/images/two-factor-auth-1.png)

## Signing in with two-factor auth

Now that your phone is successfully linked through the Google Authenticator app, you can sign
in the way you normally do, but you'll need to enter the 6-digit number generated by the app on
your phone.

> [!NOTE]
> **Note:** If you don't have the Google Authenticator app handy, you can click I don't have a code and a code will be sent to your registered email account.

1. Go to the Apigee sign-in page.
2. Enter your username and password.
3. Open the Google Authenticator app on your phone.
4. Enter the 6-digit number from the app in the sign-in page: