# Two-factor authentication

Two-factor authentication adds an authentication step for selected users. This configuration
controls where verification codes are sent and which devices remain trusted.

## Two-factor authentication at a glance

This configuration screen brings together user settings, trusted devices, and the modification
history entry point. A trusted device is a device that remains recognised for a user.

| If you need to… | Go to |
|---|---|
| Review user two-factor settings | [Two-factor authentication fields](#two-factor-authentication-fields) |
| Review trusted devices | [Trusted-device fields](#trusted-device-fields) |
| Change a user's settings | [Maintain user two-factor settings](#maintain-user-two-factor-settings) |
| Review modification history | [Review trusted devices and modifications](#review-trusted-devices-and-modifications) |
| Return to the wider configuration area | [Configuration dashboard](https://pams-doc-test-fresh.atloria.app/p/pams-doc-test-fresh-N9B4TwWn3Q/user/configuration-home) |
| Continue with user records | User-management pages for user records |

The two-factor area is a configuration table rather than the user-record form. User-record
two-factor fields remain with the user-management pages.

![The two-factor settings surface with its user rows and save actions](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/7a14f6da848ee085147832b44d000439.png)

## Before you start

You need access to the configuration area and a loaded company context before this screen can show
all of its surfaces. **Save** and **Save and Close** are available only with edit permission; both
are disabled while no data changes exist. The **Last Modifications** area appears only when a
company identifier is loaded.

Use the values and rows currently displayed. Initial checkbox selections, the exact number of user
rows, and a device row's action state depend on the loaded company data.

## Find the Two-factor authentication screen

Open the configuration screen from the **2-Factor authentication** menu entry.

**Prerequisites**

- You are signed in and can open the Configuration menu.

**Steps**

1. Open the Configuration menu.
2. Select **2-Factor authentication**.
3. Confirm that **2-Factor authentication** is visible.

![The opened Two-factor authentication screen](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/4cf5759af07de14a5753bf26a5e1aaa4.png)

**Result:** The Two-factor authentication screen is open on the two-factor surface.

## Understand the screen and its fields

The screen separates user settings from device review. The **2-Factor authentication** tab contains
the user settings grid. The **Trusted devices** tab contains the trusted-device grid. **Save** and
**Save and Close** commit settings when edit permission is present and data has changed. **Last
Modifications** opens the history surface when a company identifier is loaded.

| Surface | What it contains or does |
|---|---|
| **2-Factor authentication** | User rows and two-factor, delivery-method, and destination controls. |
| **Trusted devices** | Device rows with user, device, trust, location, and login-date information. |
| **Save** | Sends changed two-factor settings and refreshes history after a normal save. |
| **Save and Close** | Sends changed settings and leaves the page after a successful save. |
| **Last Modifications** | Opens the modification-history surface when a company identifier is loaded. |

![The Trusted devices tab with its device grid](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/e744270daddba58d86d4a220bc76b67a.png)

### Two-factor authentication fields

The two-factor grid shows one row per user presented by the loaded configuration. Its controls
describe whether two-factor authentication applies, how a verification code is delivered, and
which destination receives it.

| Column or control | What it represents | Availability |
|---|---|---|
| **User** | The user represented by the row. | A two-factor row surface. |
| **Apply 2 factor authentication** | The user's two-factor setting. | Selecting it changes that user's setting and updates the email setting. |
| **Send verification code** | The grouped delivery choices. | Contains the delivery controls below. |
| **By mail** | Mail delivery choice. | Disabled in the visible table. |
| **By SMS** | SMS delivery choice. | Disabled in the visible table. |
| **To admin.** | Sends the verification destination to the administrator option. | Disabled when the row's two-factor setting is disabled. |
| **To user** | Sends the verification destination to the user option. | Disabled when the row's two-factor setting is disabled. |

The **To admin.** and **To user** controls are row-level choices. Enablement follows the row's
**Apply 2 factor authentication** setting; it is not a separate screen-wide switch.

![The Send verification code group and its delivery choices](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/4cf5759af07de14a5753bf26a5e1aaa4.png)

### Trusted-device fields

Select **Trusted devices** to review the device rows.

| Column | What the row presents |
|---|---|
| **User** | The user associated with the device. |
| **Device name** | The device's name. |
| **Trusted machine** | Whether the device is trusted. |
| **Location** | The device location. |
| **First login at** | The first recorded login time for the device. |
| **Last login at** | The most recent recorded login time for the device. |

The trusted-device grid does not provide a column chooser. Work from the headers shown in the grid.

## Maintain user two-factor settings

Change a user's setting and verification-code destination from the user row. **Apply 2 factor
authentication** changes the selected user's setting and updates the email setting. **To admin.**
and **To user** change that user's destination flags.

**Prerequisites**

- The Two-factor authentication screen is open.
- You have edit permission.
- The user row you need is visible.

**Steps**

1. In the user row, select or clear **Apply 2 factor authentication**.
2. In the same row, choose one destination.

   | If the verification code should go to… | Select |
   |---|---|
   | The administrator | **To admin.** |
   | The user | **To user** |

    The selected destination is applied to that user's destination flags.
3. Select **Save** to keep the page open, or select **Save and Close** to leave after saving.

   | If you need to… | Select | Then expect… |
   |---|---|---|
   | Save and continue reviewing this screen | **Save** | The settings are sent and the history is refreshed after a normal save. |
   | Save and leave the screen | **Save and Close** | The settings are sent and the page closes after a successful save. |

4. Confirm the success message `Your request was completed successfully`.

If the save request fails, the screen displays `An error occurred while processing your request`.

**Result:** The selected save action has completed, and the success message is visible when the
save succeeds.

## Review trusted devices and modifications

Review device rows first, then open the history surface when a company identifier is loaded.

**Prerequisites**

- The Two-factor authentication screen is open.
- A company identifier is loaded when you need the history area.

**Steps**

1. Select **Trusted devices**.
2. Review **User**, **Device name**, **Trusted machine**, **Location**, **First login at**, and
    **Last login at**.
3. Select **Last Modifications**.
4. Review the history surface for the loaded company.

![The Last Modifications history entry point and history surface](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/547531c6506c39fd282d2ec20d930357.png)

**Result:** The trusted-device grid or the modification-history surface is open, depending on the
last control you selected.

## Handle trusted-device actions

The action on a trusted-device row depends on its trust state. A trusted device exposes **Untrust**;
an untrusted device exposes **Delete**. Each action opens a confirmation menu before the operation
is called.

**Prerequisites**

- The **Trusted devices** tab is open.
- A device row exposes its action.

**Steps**

1. Select the action exposed by the device row.

   | If the row exposes | Review | To complete the action | To leave the row unchanged |
   |---|---|---|---|
   | **Untrust** | `Are you sure you want to untrust this device?` | Select **Delete**. | Select **Cancel**. |
   | **Delete** | `Are you sure you want to delete this device?` | Select **Delete**. | Select **Cancel**. |

![A trusted-device row with its available action and confirmation menu](https://atloriaassets.blob.core.windows.net/assets/a438221c-c1af-407c-b9e6-a56c986db846/e744270daddba58d86d4a220bc76b67a.png)

The available action belongs to the individual row. Use the confirmation text before committing a
device change.

**Result:** The confirmation menu is either closed with **Cancel** or submitted with **Delete** for
the selected device action.

## When a setting or device action does not work

Use this table to match what you see with the condition that controls the surface.

| What you see | What it means | What to do |
|---|---|---|
| **Save** is disabled. | No data changes exist. | Change a supported user setting first, then check **Save** again. |
| **Last Modifications** is absent. | No company identifier is loaded. | Load the company context before opening history. |
| The first two-factor grid is absent. | That grid declaration is behind a false display guard. | Use the visible two-factor table and its row controls. |
| A required-field message does not appear. | This screen declares no required-field or validation rules. | Review the row controls and save state rather than looking for a field-validation panel. |
| The save request reports an error. | The request was not completed. | Review the changed settings and contact your administrator if the error continues. The message is `An error occurred while processing your request`. |
| The initial values or row count differ from an example. | Loaded data determines the checkbox values and exact rows. | Work from the values and rows currently displayed. |

## What to do next

This page manages the configuration table. Continue to the [Configuration dashboard](https://pams-doc-test-fresh.atloria.app/p/pams-doc-test-fresh-N9B4TwWn3Q/user/configuration-home)
for another configuration area. For user-record details, continue to the user-management pages.
User-record two-factor fields are outside this page.

Shared log-history filters, registration details, and generic popup actions such as **Don't Save**,
**Upload**, **No**, **Yes**, **Ok**, and **Back** belong to their owning shared surfaces rather than
this configuration page.

## Related

- Continue to the [Configuration dashboard](https://pams-doc-test-fresh.atloria.app/p/pams-doc-test-fresh-N9B4TwWn3Q/user/configuration-home) for another configuration area.
- Continue to the user-management pages for user-record details.
