FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
agomes
Staff
Staff
Article Id 370414
Description This article describes how to set up client-to-site IPsec VPN configuration with SAML authentication through the Azure portal.
Scope FortiGate v7.2.0 and later
Solution

Inside Enterprise Applications on the Azure portal, follow the steps below:

 

  1. Create a new FortiGate VPN SSL-type application.

 

2025-01-15 13_02_25-Browse Microsoft Entra Gallery - Microsoft Azure and 1 more page - Perfil 1 - Mi.png

 

  1. Rename the application as desired and select the Create button.

2025-01-15 13_03_45-FortiGate SSL VPN - Microsoft Azure and 1 more page - Perfil 1 - Microsoft​ Edge.png

 

  1. When the application is created, go into it and add the users who can connect to the VPN.

2025-01-15 13_07_07-FortiGate IPSEC SAML - Microsoft Azure and 1 more page - Perfil 1 - Microsoft​ E.png

 

  1. Select single sign-on in the left menu and then in SAML to start the basic SAML configuration.
  2. Edit the Basic SAML Configuration panel.
  3. Copy the pattern on Identifier ID https://*.FORTIGATE-FQDN.com/remote/saml/metadata, change it with the VPN address, remove https and replace it with HTTP, and add a / into the field. See the example below.

 

http://*.FORTIGATE-FQDN.com/remote/saml/metadata/

 

Do not forget to add the VPN port to the pattern. For example:

 

http://vpnnamehere.com:10443/remote/saml/metadata/

 

Do the same to the reply URL, Sign-on URL, and logout URL. For these three fields, it is not necessary to change https to HTTP and add a / at the end of the URL.

 

2025-01-15 13_22_19-Basic SAML Configuration - Microsoft Azure and 1 more page - Perfil 1 - Microsof.png

 

  1. Inside Attributes & Claims, perform the following steps.

  • Delete the claim user.groups [SEcurityGroups].
  • Add a new claim called username with value user.principalname.
  • Add a new group claim, choose the All groups option, and source attribute as Group ID.
  • In advanced options still inside the group claim select the option 'Customize the name of the group claim' and add the name as 'group' without quotes.

 

The Attribute and Claim configuration need to be like the ones in the following image:

 

2025-01-15 13_31_26-Group Claims - Microsoft Azure and 1 more page - Perfil 1 - Microsoft​ Edge.png

 

Come back to the single sign-on configuration.

 

  1. Download the Certificate (Base64) and import it into the FortiGate as a Remote Certificate.

2025-01-15 13_32_44-FortiGate IPSEC SAML - Microsoft Azure and 1 more page - Perfil 1 - Microsoft​ E.png

 

2025-01-15 13_35_34-FortiGate - <span class='highlight' style='background-color:yellow'>FGT</span>-CASA and 7 more pages - Personal - Microsoft​ Edge.png

 

It is possible to rename this certificate in the CLI to make it easier to identify it through the following command:

 

config vpn certificate remote

 

  1. In the FortiGate configuration go to User & Authentication and Authentication Settings. Change the certificate to the wildcard or use the Fortinet_Factory.
  2. Go to Single Sign-on, select Create New, and follow the steps below.

 

  • Into the address field use the same address that was used in the Azure single sign-on configuration. vpnnamehere.com:10443
  • On the certificate use Fortinet_Factory and select Next.
  • On the identity provider details, select the custom option.
  • See the table below to fill in correct the fields by just copying the information in the fields.

 

2025-01-15 13_47_43-FortiGate IPSEC SAML - Microsoft Azure and 1 more page - Perfil 1 - Microsoft​ E.png


2025-01-15 13_51_49-FortiGate - <span class='highlight' style='background-color:yellow'>FGT</span>-CASA and 7 more pages - Personal - Microsoft​ Edge.png

 

  • Use the certificate that was imported before.
  • In the attributes, use the username and groups for the respective fields.

 

2025-01-15 13_54_11-FortiGate - <span class='highlight' style='background-color:yellow'>FGT</span>-CASA and 7 more pages - Personal - Microsoft​ Edge.png

 

  1. Create a group inside the User Groups like the picture below.

Pay attention to using the remote server the single sign-on server that was created before and choose the option any to the groups.

 

2025-01-15 13_56_30-FortiGate - <span class='highlight' style='background-color:yellow'>FGT</span>-CASA and 7 more pages - Personal - Microsoft​ Edge.png

 

  1. Create a VPN IPsec tunnel as a dial-up tunnel.

2025-01-15 13_59_08-FortiGate - <span class='highlight' style='background-color:yellow'>FGT</span>-CASA and 7 more pages - Personal - Microsoft​ Edge.png

 

Add the following commands inside the phase1-interface configuration:

 

    set eap enable
    set eap-identity send-request

 

  1. Inside the config system global settings, add the command 'set auth-ike-saml-port 9443'. Note that this command is only supported on FortiGate 7.2.0 and later.
  2. Inside the link interface that will receive the connections add the command to set ike-saml-server to 'SINGLE SIGN-ON PROFILE'.
  3. Create a policy to control the traffic.

 

2025-01-15 14_04_18-FortiGate - <span class='highlight' style='background-color:yellow'>FGT</span>-CASA and 7 more pages - Personal - Microsoft​ Edge.png

 

 

  1. Configure the remote access profile in the FortiClient and fill in the information as configured into the VPN configuration.

2025-01-15 14_06_29-172.16.2.105 - Remote Desktop Connection.png

 

2025-01-15 14_12_34-Window.png

 

  1. Check the connectivity as per the policy that was created before.
  2. Use the troubleshooting commands below to check the SAML logs during the connection.

 

diagnose debug application samld -1

diagnose debug enable

 

Related document:

IPsec VPN SAML-based authentication 

Comments
a677579
Staff
Staff

Very useful and well explained!!! Thanks!