# How to set up 2FA

These instructions explain how to set up 2FA services in the Back Office, enabling your clients to use Google Authenticator or SMS for 2FA in the B2CORE UI to secure their profiles.

## How to set up 2FA with Google Authenticator

To provide your clients with the option to use Google Authenticator for 2FA in the B2CORE UI, configure the following settings in the Back Office:

{% stepper %}
{% step %}
Navigate to **System** > **Settings** and configure the following options in the **Two-factor authentication** section:

* **Enabled Two-factor auth providers** — select **Google Authenticator** to make this 2FA option available to your clients in the B2Core UI.
* **Google authenticator service name** — enter a name (for example, your company name) that will be displayed to clients in the Google Authenticator app. This name can be changed if needed.

For more details, refer to [Settings](https://docs.b2core.b2broker.com/back-office-guide/system/settings).
{% endstep %}

{% step %}
Verify the configuration of the related wizards:

* **2FA Google Authenticator**
* **2FA Google Auth**

  Ensure these wizards are enabled and have no restrictions:

  * Navigate to **System** > **Wizards**.
  * Find the required wizard and click **Edit**.
  * Go to the **Workflow** tab.
  * For each wizard step, click **Actions**, then select **Country restrictions**, **Client type restriction**, or **Jurisdiction restriction**.
  * In the **Restrictions** popup for each option, confirm that **Enabled** is set to **No**.
    {% endstep %}
    {% endstepper %}

Clients can now enable and use 2FA via Google Authenticator in the B2CORE UI to secure their profiles.

## How to set up 2FA with SMS

{% hint style="info" %}
Before setting up 2FA with SMS, make sure that you have added and configured a 2FA SMS provider (such as [Twilio](https://docs.b2core.b2broker.com/how-to-articles/manage-communication-platforms/how-to-configure-twilio) or Vonage).
{% endhint %}

To provide your clients with the option to use 2FA via SMS in the B2CORE UI, configure the following settings in the Back Office:

{% stepper %}
{% step %}
Navigate to **System** > **Settings** and configure the following options:

In the **Client settings** section:

* **Unique phone** — select **Enabled** to ensure phone numbers are unique for each client.

In the **Other settings** section:

* **Confirmation phone code lifetime** — specify the period, in seconds, during which a verification code sent to a client phone number is valid.
* **Sms limit for each recipient** — specify the maximum number of verification code messages that can be requested by a client per day.

In the **Two-factor authentication** section:

* **Enabled two-factor auth providers** — select **SMS** to make this 2FA option available to your clients in the B2Core UI.

For more details, refer to [Settings](https://docs.b2core.b2broker.com/back-office-guide/system/settings).
{% endstep %}

{% step %}
Create a template for delivering 2FA codes via SMS:

* Navigate to **System** > **Templates** > **Sms** > **Confirmation Templates**.
* Click **+Create** in the upper-right page corner.
* On the **Create template** page, fill in the following fields:

  * In the **Name** field, enter `default`.
  * In the **Caption** field, enter a name that you want to use for the template in the Back Office (such as `2FA SMS`).
  * In the **Template** field, specify the message text, such as:

  `<Your company name>: Your verification code is %CODE%.`
* Click **Save** to save the template.
  {% endstep %}

{% step %}
Verify the configuration of the related wizards:

* **2FA SMS**
* **2FA SMS Auth**
* **Phone Confirm**

  Ensure these wizards are enabled and have no restrictions:

  * Navigate to **System** > **Wizards**.
  * Find the required wizard and click **Edit**.
  * Go to the **Workflow** tab.
  * For each wizard step, click **Actions**, then select **Country restrictions**, **Client type restriction**, or **Jurisdiction restriction**.
  * In the **Restrictions** popup for each option, confirm that **Enabled** is set to **No**.
    {% endstep %}
    {% endstepper %}

Clients can now enable and use 2FA via SMS in the B2CORE UI to secure their profiles.

In addition, you can enable client phone number confirmation during registration by delivering verification codes via SMS (for details, refer to [How to add and configure the registration wizard](https://docs.b2core.b2broker.com/how-to-articles/manage-system-settings/how-to-set-up-the-registration-wazard/how-to-add-and-configure-the-registration-wizard)).

### How to test operation of 2FA with SMS

After you have configured 2FA with SMS in the Back Office, you can test its operation as follows:

{% stepper %}
{% step %}
Sign in to the B2CORE UI.
{% endstep %}

{% step %}
Click the profile icon in the upper-right page corner, and then select **Security** in the dropdown.
{% endstep %}

{% step %}
In the **Two-factor authentication** section, enable the **SMS Confirmation** option.
{% endstep %}

{% step %}
Enter your phone number in the displayed form.
{% endstep %}

{% step %}
Click **Continue**.
{% endstep %}
{% endstepper %}

If you have received a verification code to a specified phone number, 2FA with SMS operates properly.
