|
1 | 1 | # Multi-Factor Authentication (MFA/2FA)
|
2 | 2 |
|
3 |
| -Defguard supports Multi-Factor Authentication for WireGuard with **TOTP & Email codes** and after that with **session keys based on Wireguard Pre-Shared Keys** (PSK). For more details about this please refer to the [architecture section](architecture.md). |
| 3 | +We support two types of Multi-Factor Authentication: |
4 | 4 |
|
5 |
| -{% hint style="warning" %} |
6 |
| -MFA requires: |
| 5 | +1. Based on our [Internal OIDC/SSO](../../openid-connect/) - called [Internal MFA ](./#internal-mfa)- using this method the Desktop & Mobile clients authenticate with **TOTP & Email codes** and after that with **session keys based on Wireguard Pre-Shared Keys** (PSK). For more details about this please refer to the [architecture section](architecture.md). |
| 6 | +2. Based on [External OIDC/SSO](../../external-openid-providers/) - called [External MFA](./#externa-mfa) - this method is supported from version 1.5 ([currently in alpha](../../../deployment-strategies/pre-production-and-development-releases.md)) and requires the External SSO to be configured in the system. Each connection when using this method will open a web browser with authentication session to the SSO (like Google/Microsoft Entra/Okta/....) and after successful authentication **session keys based on WireGuard Pre-Shared Keys** (PSK) are exchanged between the client and server (for more details about this please refer to the [architecture section](architecture.md)). |
7 | 7 |
|
8 |
| -* Defguard core >= v0.9.0 |
9 |
| -* Defguard proxy >= v0.3.0 |
10 |
| -* Desktop client >= 0.2.0 |
| 8 | +{% hint style="success" %} |
| 9 | +From version 1.5 ([currently in alpha](../../../deployment-strategies/pre-production-and-development-releases.md)) **each VPN Location can be configured to use either Internal or External MFA.** |
11 | 10 | {% endhint %}
|
12 | 11 |
|
13 |
| -## Enabling MFA for a selected VPN/Location |
| 12 | +## Internal MFA |
14 | 13 |
|
15 |
| -Enabling MFA for a desired VPN Location is done by: |
| 14 | +Enabling Internal MFA for a desired VPN Location is done by: |
16 | 15 |
|
17 | 16 | 1. going into Defguard to **VPN Overview**
|
18 | 17 | 2. selecting the VPN Location from the dropdown list, and pressing the **Edit Location** button in the top right corner of the page
|
@@ -67,3 +66,40 @@ An error message will be shown if users attempt to select a MFA method that has
|
67 | 66 | ### Successful authentication
|
68 | 67 |
|
69 | 68 | If authentication succeeds, the vpn two factor authentication modal will be closed and connection to the selected VPN will be attempted. Users will be asked to authenticate on every connection to a VPN with MFA enabled.
|
| 69 | + |
| 70 | +## External MFA |
| 71 | + |
| 72 | +In order to enable the External MFA authentication: |
| 73 | + |
| 74 | +1. Your instance **must have** [external OIDC/SSO configured](../../external-openid-providers/). |
| 75 | +2. Select the VPN Location from the dropdown list on the Network Overview, and pressing the **Edit Location** button in the top right corner of the page. |
| 76 | +3. Select the External MFA in the M |
| 77 | + |
| 78 | +<figure><img src="../../../.gitbook/assets/Screenshot 2025-07-29 at 17.29.25.png" alt=""><figcaption></figcaption></figure> |
| 79 | + |
| 80 | +#### Client disconnect threshold |
| 81 | + |
| 82 | +When MFA is enabled on a location, Defguard periodically (currently every **1 minute**) checks statistics if a client is connected and if the period of inactivity (defined in this option) is met, a client is disconnected. |
| 83 | + |
| 84 | +Thus the gateway needs to be configured to send statistics in that period. |
| 85 | + |
| 86 | +{% hint style="info" %} |
| 87 | +We recommend to set: |
| 88 | + |
| 89 | +* gateway to send statistics every 30sec |
| 90 | +* Peer disconnect threshold we recommend it to be min. 300 (5 min) |
| 91 | +{% endhint %} |
| 92 | + |
| 93 | +### Testing MFA on Defguard client |
| 94 | + |
| 95 | +When a location has External MFA enabled, after clicking Connect in the Desktop client, there will be information displayed about authentication requirement: |
| 96 | + |
| 97 | +<figure><img src="../../../.gitbook/assets/Screenshot 2025-07-29 at 17.32.51.png" alt="" width="375"><figcaption></figcaption></figure> |
| 98 | + |
| 99 | +In order to authenticate the user will be prompted to click on Authenticate with your configured OIDC (like Authenticate with Google) - which will open the browser and start the authentication session with your OIDC/SSO provider by the [Defguard Enrollment ](../../../help/enrollment/)service (which is the only public component). |
| 100 | + |
| 101 | +After successful authentication the user will be informed by the enrollment service like so: |
| 102 | + |
| 103 | +<figure><img src="../../../.gitbook/assets/Screenshot 2025-07-29 at 17.33.21.png" alt="" width="375"><figcaption></figcaption></figure> |
| 104 | + |
| 105 | +And the VPN should be connected. |
0 commit comments