# Two-factor authentication
URL: https://docs.datarobot.com/en/docs/platform/acct-settings/2fa.html

> How to set up two-factor authentication (2FA), an opt-in feature that provides additional security for DataRobot users.

# Two-factor authentication

Two-factor authentication (2FA) is an opt-in feature that provides additional security for DataRobot users. 2FA in DataRobot is based on the Time-based One-Time Password algorithm ( [TOTP](https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm)), the IETF RFC 6238 standard for many two-factor authentication systems. It works by generating a temporary, one-time password that must be manually entered into the app to authenticate access.

To work with 2FA, you use an authentication app on your mobile device (for example, [Google Authenticator](https://support.google.com/accounts/answer/1066447?co=GENIE.Platform%3DAndroid&hl=en)). If you haven't already done so, install and register an app on your device. You will use the app to scan a DataRobot-provided QR code, which will, in turn, generate authentication and recovery codes.

DataRobot provides a series of recovery codes for use if you lose access to your default authentication method.

> [!WARNING] Warning
> Before completing two-factor authentication, download, copy, or print these codes and save them to a secure location.

> [!TIP] Tip
> When you enable 2FA, all API endpoints that validate username and password require secondary authentication.

See the [troubleshooting](https://docs.datarobot.com/en/docs/platform/acct-settings/2fa.html#troubleshooting) section for additional information.

## Set up 2FA

The 2FA setup workflow varies depending on if you're a Self-managed or SaaS user:

**SaaS:**
To enable 2FA:

Click the
Authentication
tab from the
User Settings
page and switch the
Two-Factor Authentication
toggle to on:
Click
Setup
to start the setup process.
DataRobot navigates back to the login screen, displaying a QR code to scan. Open the authenticator app on your device and select the option to scan a barcode. (On Google Authenticator, click the
+
sign and choose "Scan barcode.")
Scan the QR code shown in the dialog box; your device displays a 6-digit code. If you have trouble scanning, see the
alternate option
. If you receive an error using either method, see the
troubleshooting
section.
Enter the code (no spaces) into the box at the bottom of the screen and click the arrow to proceed.
Once verified, DataRobot returns a recovery code for use if you lose access to the default authentication method.
Save the code in a secure place.
Select a method for saving your code and click the arrow to proceed. DataRobot briefly displays a notice that two-factor authentication is enabled.

**Self-managed:**
To enable 2FA:

Click the
Authentication
tab from the
User Settings
page and switch the
Two-Factor Authentication
toggle to on:
Click
Setup
to start the setup process.
Open the authenticator app on your device and select the option that allows you to scan a barcode. (On Google Authenticator, click the
+
sign and choose "Scan barcode.")
Scan the QR code shown in the dialog box; your device displays a 6-digit code. If you have trouble scanning, see the
alternate option
. If you receive an error using either method, see the
troubleshooting
section.
Enter the code (no spaces) into the box at the bottom of the screen and click the arrow to proceed.
Once verified, DataRobot returns a recovery code for use if you lose access to the default authentication method.
Save the code in a secure place.
Select a method for saving your codes and click
Complete
. DataRobot briefly displays a notice that two-factor authentication is enabled.


### Non-QR code method

If you could not scan the QR code:

1. From the login screen, clickUse the recovery code:
2. Enter the recovery code provided when you configured two-factor authentication and clickVerify. Return tostep 4 of "Set up 2FA", above. Or, if you receive an error, see thetroubleshootingsection.

If you do not have your recovery code, contact your DataRobot representative for assistance.

## Use 2FA

After you enable and set up 2FA, you will be prompted for a code each time you log into DataRobot. (You are also prompted for an authentication code when requesting a password reset from the login page.) Open DataRobot and enter your email and password, or sign in with Google. You are prompted for an authentication code:

If you have your mobile device available, open the authenticator app and enter the 6-digit code displayed. If you do not have your device, click Switch to recovery code and enter one of the codes from your saved list of codes.

If you lose access to your phone and recovery codes, contact your administrator or DataRobot Support.

## Troubleshooting

See the table below for troubleshooting assistance:

| Problem | Solution | Cause |
| --- | --- | --- |
| I don't see the option to enable two-factor authentication in my user settings | When logging in to DataRobot, your account must use the username/password authentication method. Contact your DataRobot administrator for more information. | 2FA is only available for the username/password authentication method. |
| I am receiving a message that my code is invalid | Rename or delete any DataRobot accounts listed in your authentication app. To do this with Google, for example, click the pencil icon and select all accounts registered to DataRobot. Select DELETE and when prompted, select REMOVE ACCOUNTS. (To reinstate the account, you can toggle "Enable two-factor authentication" in Settings and recapture the QR code). | Make sure that you have only one instance of DataRobot authentication in your authenticator app. Each time you scan the QR code, the authenticator app creates a new account based on that code. The code you enter must be associated with the QR code displayed, and with multiple entries, it can be unclear which code to enter. |
| So many codes | When prompted for a code, enter the last DataRobot entry. | Some authentication systems (Google, for example) add new accounts to the bottom of the list. |
| I lost my codes | If you lose access to your phone and recovery codes, contact your administrator or DataRobot Support. | N/A |
| I no longer want to use 2FA | Toggle the feature off on the Settings page. Enter a 6-digit authentication code or a saved recovery code and click Disable. The feature is removed from your account, but you can re-enable it at any time. | N/A |
| I forgot my password but I have my code | From the login page, click Don't Remember? and then on the next screen, click Reset Password. When prompted, enter your authentication app code or, if you don't have your mobile device, click Switch to recovery code and enter one of your saved codes. DataRobot will send a link to reset your password. | N/A |

---
