# Facial Biometrics Integration Guide via SAML-IPsec Protocol

#### Prerequisites

Before starting the setup process, ensure the following item is available:

1. **Digital Certificate:** The digital certificate provided by Facesign is essential to establish trust between the FortiGate (Service Provider) and the Facesign platform (Identity Provider). Import this certificate into your FortiGate appliance before proceeding.

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FnH03LvGZkypxvklJX9oN%2Fimage.png?alt=media&#x26;token=908e3504-1935-4b74-b7e4-5fa7a0e025c5" alt=""><figcaption></figcaption></figure>

***

### 1. Single Sign-On (SSO) Configuration with Facesign

The first step is to register Facesign as a SAML identity provider on the FortiGate.

1. Access the FortiGate administration interface and navigate to **User & Authentication > Single Sign-On.**

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FqWuXE3xKaNsktKzt02aq%2Fdoc.jpg?alt=media&#x26;token=f606353f-fd5e-48ad-8d50-4b46b2d2508d" alt=""><figcaption></figcaption></figure>

1. Create a new SSO entry with the following specifications:

* **Name**: `Facesign SAML` (or a descriptive name of your choice).
* **Service Provider Configuration:**
  * **Address:** Enter the external access address of your VPN, in the format <mark style="color:$info;">`vpn.yourdomain.com.br:xxxx`</mark>. You may use the IP address and the corresponding port.
* **Identity Provider Details:**
  * Use the URLs (Entity ID, Single Sign-on service URL, Single logout service URL) provided by the Facesign portal.
  * Import the Facesign digital certificate previously uploaded to the FortiGate.

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FzIwbuFKwJqWNJvAxAy2k%2Fimage.png?alt=media&#x26;token=e40b267e-8463-413d-ac5d-4361d481e8a2" alt=""><figcaption></figcaption></figure>

3. After creation, edit the SSO configuration and, in the **AD FS claim**section, enable the corresponding option to ensure correct interpretation of authentication attributes.

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2Fuw4Yy5WxXuhrQMEgWSeZ%2Fimage.png?alt=media&#x26;token=e9d3ad99-0ce1-429e-8e17-9c96b0821d18" alt=""><figcaption></figcaption></figure>

***

### 2. VPN User Group Configuration

Create a user group that will be associated with SAML authentication.

1. Navigate to **User & Authentication > User Groups.**
2. Create a new user group with the following characteristics:

* **Name:** `GRP_VPN_SAML_FACESIGN` (or a descriptive name).
* **Type**: `Firewall`.
* **Remote Groups**: Add the SSO server created in the previous step (`Facesign SAML`) as a member of this group.

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FlunAF5eZzn1wYNF41J0k%2Fdoc%20II.jpg?alt=media&#x26;token=dea24031-c2c9-44c0-98e6-39870b7236d3" alt=""><figcaption></figcaption></figure>

***

### 3. IPsec VPN Tunnel Configuration

This section details the creation and configuration of the IPsec tunnel.

1. Go to **VPN > IPsec Tunnels** and start the creation wizard (`VPN Creation Wizard`).
2. Select the template **Custom** and set a name for the tunnel, such as `SAML_VPN.`

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FaSIF9emAsIUmef5qJvuP%2Fimage.png?alt=media&#x26;token=4df4c586-2c77-4334-8192-9881a74f529b" alt=""><figcaption></figcaption></figure>

3. **Network Settings (Network):**

* **IP Version:** IPv4.
* **Remote Gateway:** Dialup User.
* **Interface**: Select the corresponding WAN interface.
* **Client Address Range**: Define the range of IP addresses that will be assigned to VPN clients.
* **DNS Server:** Specify the DNS servers that will be used by connected clients.
* **Accessible Networks**: Define the internal networks that can be accessed through the VPN.

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FndI1h4FoJELkNxDeFchy%2Fimage.png?alt=media&#x26;token=bf71628f-2798-41b8-983d-69adc17819e8" alt=""><figcaption></figcaption></figure>

4. **Authentication Settings (Authentication):**

* **Method**: Pre-shared Key.
* **Version**: IKEv2.
* **Peer Types:** Any peer ID.

5. **Phase 1 Settings (Phase 1 Proposal):**

* **Encryption/Authentication:** Select the desired algorithms (e.g., AES256/SHA256).
* **Diffie-Hellman Group:** Select the appropriate groups (e.g., 14, 5).
* **Key Lifetime:** 86400 seconds.

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FU7yCN3QqfXxfhAykdOu7%2Fimage.png?alt=media&#x26;token=89aca37f-695f-420a-825e-51d5f3de4ad6" alt=""><figcaption></figcaption></figure>

6. **Phase 2 Settings (Phase 2 Selectors):**

* **Encryption/Authentication:** Select the desired algorithms (e.g., AES128/SHA256).
* **Enable Perfect Forward Secrecy (PFS):** Enabled.
* **Diffie-Hellman Group:** Select the appropriate group (e.g., 5).
* **Key Lifetime:** 43200 seconds.
* **Autokey Keep Alive:** Enabled.

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FYIMiDWJc23oZI7FEWfpf%2Fimage.png?alt=media&#x26;token=ede63e06-6c4e-40db-98ff-2a2a7af9eaef" alt=""><figcaption></figcaption></figure>

#### 3.1. Adjustments via Command Line (CLI)

To enable EAP (Extensible Authentication Protocol) authentication, required for SAML integration, run the following commands in the FortiGate CLI:

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FIBKyXN0mTd7LINF8Bv6T%2Fimage.png?alt=media&#x26;token=131cb063-e02e-462a-b37d-3e83e7d3d8ff" alt=""><figcaption></figcaption></figure>

Then configure the listening port for SAML authentication in global mode:

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2F6VRRm7mmOAW1iUlMdyjR%2Fimage.png?alt=media&#x26;token=3d082044-e3b6-496a-9d67-5e9b8b61901d" alt=""><figcaption></figcaption></figure>

Finally, associate the SAML server with the corresponding network interface:

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FVdPa2xWdBNBLtI17zf7o%2Fimage.png?alt=media&#x26;token=4d1ad914-6557-493c-ae8b-1f3b02a61330" alt=""><figcaption></figcaption></figure>

***

### 4. Access Policy (Firewall Policy) Configuration

Create a firewall policy to allow VPN traffic to the internal network.

1. Navigate to **Policy & Objects > Firewall Policy.**
2. Create a new policy with the following parameters:

* **Name**: `VPN_SAML_LAN` (or a descriptive name).
* **Incoming Interface:** The IPsec tunnel interface (`SAML_VPN`).
* **Outgoing Interface:** Your local network (LAN) interface.
* **Source**: The user group (`GRP_VPN_SAML_FACESIGN`) and the VPN IP range.
* **Destination**: The local network that will be accessed.
* **Service**: `ALL` (or specific services).
* **Action**: `ACCEPT`.
* **Inspection Mode:** Flow-based.

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2Frzvvp3OTm1SCFuJU4WtF%2Fimage.png?alt=media&#x26;token=b6451db6-af75-40fb-87ce-10cda7c32994" alt=""><figcaption></figcaption></figure>

***

### 5. VPN Client Configuration (FortiClient)

On the endpoint client, configure the IPsec VPN connection in FortiClient.

1. Create a new VPN connection with the following settings:

* **VPN Type:** IPsec VPN.
* **Connection Name:** `IPSEC FACESIGN` (or a descriptive name).
* **Remote Gateway**: The external address of your VPN (`vpn.facesign.in`).
* **Authentication Method:** Pre-shared Key.
* **Single Sign-On (SSO) for VPN Tunnel:** Enable.

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FN6Anv7g1tdAu13oUsEWg%2Fimage.png?alt=media&#x26;token=bc773658-15a6-4a9c-bd9f-429097489a5c" alt=""><figcaption></figcaption></figure>

2. Configure the **Phase 1** and **Phase 2** proposals so they match the settings defined on the firewall (IKE Proposal, DH Group, Key Lifetime, etc.).

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FSibo3vLx9nliWsRtkz69%2Fimage.png?alt=media&#x26;token=0aeac704-1331-44a3-bed5-e52b0d4b9cf3" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FHflJf11Bdp5D19wYTpub%2Fimage.png?alt=media&#x26;token=9798621c-a1ef-49d0-a769-e4748c6aefa5" alt=""><figcaption></figcaption></figure>

***

### 6. Connection and Authentication Process

1. In FortiClient, the user selects the connection `VPN_SAML_IPSEC` and clicks **Connect**.

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FRAqCBEPzxuSD7p9xtCq2%2Fimage.png?alt=media&#x26;token=bb2807b1-e02e-4ea6-9d02-8d3cf4b78ee9" alt=""><figcaption></figcaption></figure>

2. A Facesign SAML authentication window will be displayed, requesting **biometric authentication.**

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FsxYbjLiVgfQKTYZOi187%2Fimage.png?alt=media&#x26;token=4ffb45bd-1ceb-49bb-be5b-f1c9dc0be94d" alt=""><figcaption></figcaption></figure>

3. After successful biometric verification, the **VPN** connection is established, and the user will have access to the internal network resources defined in the firewall policy.

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2ForLvODOUn9KkH6Gn0lhn%2Fimage.png?alt=media&#x26;token=54f924c6-eebe-4935-a615-71b6680208da" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1944264865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZHOws1GppZYJspgX4wu1%2Fuploads%2FnBVUTL2t03pnVr9xbNDz%2Fimage.png?alt=media&#x26;token=4306ba44-cc7a-46e0-bfa7-808cbdb936bd" alt=""><figcaption></figcaption></figure>

***

### Support and Contact

For technical support or questions, use the FaceSign Admin Portal or contact our team through the official channels.
