Configuring FortiAuthenticator as SAML IdP and FortiGate as SAML SP
This topic discusses the configuration steps required on FortiAuthenticator to act as the Identity Provider (IdP) and FortiGate to act as Service Provider (SP) during SAML Authentication for IPsec connection, as a part of the overall configuration in SAML-based authentication for FortiClient remote access dialup IPsec VPN clients.
In the example discussed, the following assumptions and configuration steps are used:
-
FortiAuthenticator is configured with local user (testuser) inside a User group (IT).
-
This user belongs to a unique realm (samlrealm).
-
FortiAuthenticator also requires a server certificate (also called as IdP certificate) for itself signed by a well-known CA or trusted by FortiClient endpoint and FortiGate.
-
The IdP certificate must be imported into FortiGate after which FortiAuthenticator can use the certificate to sign the SAML messages.
-
FortiAuthenticator must then be configured as SAML IdP and FortiGate as SAML SP.
To configure a local user on FortiAuthenticator:
-
Go to Authentication > User Management > Local Users and select Create New.
-
Enter the following details shown below and leave other settings as the defaults.
Username testuser Password creation Specify a password Password Enter a desired password Password confirmation Re-enter the password -
Click Save.
For more advanced and custom configuration options, see Local users.
To configure a user group on FortiAuthenticator:
-
Go to Authentication > User Management > User Groups and select Create New.
-
To create a user group with a local user:
-
In the Name field, enter the group name as IT.
-
Set the Type as Local.
-
Under Users, from the Available Users table, select testuser and move it to the Chosen Users table.
-
-
Click Save.
For more advanced options, see User Groups.
To configure a user realm on FortiAuthenticator:
-
Go to Authentication > User Management > Realms and select Create New.
-
Name the realm as samlrealm.
-
In User source, from the dropdown, select Local Users.
-
Click Save.
For more advanced options, see Realms.
To import a server certificate on FortiAuthenticator:
-
Go to Certificate Management > End Entities > Local Services and select Import.
-
Depending on which file format your certificate is in, select the suitable Type.
-
Select Upload a file to locate the certificate file on your computer.
-
Click Import.
See End entities for more information on certificates on FortiAuthenticator.
To configure general SAML IdP settings on FortiAuthenticator for SAML:
-
Go to Authentication > SAML IdP > General, and select Enable SAML Identity Provider portal.
-
Configure the following settings:
Device FQDN <FortiAuthenticator FQDN>
To configure this setting, you must enter a Device FQDN in the System Information widget in the Dashboard.
Server address <FortiAuthenticator FQDN>
Enter the IP address or FQDN of the FortiAuthenticator device. This address must be accessible by the FortiClient endpoint.
Username input format username@realm Use default realm when user-provided realm is different from all configured realms Disabled Realms Realm: samlrealm
(Optional) Groups > Filter: IT
Use Groups and Filter to add specific user groups. These user groups may be local users configured on the FortiAuthenticator itself or remote users populated from different remote authentication servers. See User Groups and Remote users for more information.
Legacy login sequence Disabled Default IdP certificate <IdP certificate>
This certificate is used by IdP to sign SAML messages before sending it to IdP. To import this certificate on FortiAuthenticator see Importing a server certificate. This certificate also needs to be imported on the SP (FortiGate) to be used in the SAML configuration. See Remote certificate.
-
Select Save to apply any changes that you have made.
To configure service provider SAML settings on FortiAuthenticator for SAML:
-
Go to SAML IdP > Service Providers.
-
Click Create New.
-
Enter the following:
SP name FortiGate
Use any suitable SP name.
Server certificate <IdP certificate>
This certificate is used by IdP to sign SAML messages before sending it to IdP. To import this certificate on FortiAuthenticator, see Importing a server certificate. This certificate also needs to be imported on the SP (FortiGate) to be used in the SAML configuration. See Remote certificate.
IdP Metadata Select an identifier to display IdP info Click + to create a new IdP prefix. In the IdP identifier field, enter the prefix as fac and click OK.
Fields such as IdP entity id, IdP single sign-on URL, and IdP single logout URL will populate automatically with this prefix information. These URLs must be accessible by FortiClient endpoints. Copy and paste this URL information in a separate notepad file as it will be used to configure IdP information on SP (FortiGate) later.
Authentication Authentication Method Password-only Assertion Attributes Click + to expand it.
Configure two SAML assertion attributes (username and group) as follows:
Assertion attribute
SAML attribute
username
User attribute
FortiAuthenticator > Username
Assertion attribute
SAML attribute
group
User attribute FortiAuthenticator > Group -
Click Save.
To export SAML IdP server certificate and import it on FortiGate:
-
On FortiAuthenticator, go to Certificate Management > End Entities > Local Services.
-
Select the certificate, <IdP certificate>, by selecting the left checkbox for the certificate entry in the table and clicking Export Certificate.
-
Go to the file location on your local computer and click Save.
-
On FortiGate, go to System > Certificates, and from the Create/Import dropdown, select Remote Certificate.
-
Select Upload to locate and upload the .cer remote certificate from your computer.
-
Click OK.
The new certificate is now visible in the System > Certificates page under Remote Certificate.
To configure SAML server on FortiGate:
-
Go to User & Authentication > Single Sign-On.
-
Click Create New.
-
Enter the Name as saml-fac.
-
In the Address field, enter the FQDN/IP information in the following format:
<ipsec-vpn-gateway-fqdn/ip-address>:<saml-ike-authentication-port>
The Address field is used by FortiClient to initiate IPsec connection to FortiGate.
-
On the FortiGate, from Service Provider Configuration, copy the following URLs (Entity ID, Assertion consumer service URL, Single logout service URL). In FortiAuthenticator, enter it in Authentication > SAML IdP > Service Providers > FortiGate, inside the SP Metadata fields according to following mapping:
FortiGate settings
FortiAuthenticator settings
Entity ID SP entity ID Assertion consumer service URL SP ACS (login) URL Single logout service URL SP SLS (logout) URL The following demonstrates on the FortiGate:
The following demonstrates on FortiAuthenticator:
-
Click Save on FortiAuthenticator to save the SP URLs.
-
Return to FortiGate GUI, and click Next.
Set the Type as Custom.The Entity ID, Assertion consumer service URL, and Single logout service URL fields required are available from FortiAuthenticator.
-
To copy the following URLs (IdP entity id, IdP single sign-on URL, IdP single logout URL) from FortiAuthenticator, go to Authentication > SAML IdP > Service Providers > FortiGate under IdP Metadata. Copy the URLs from FortiAuthenticator and paste it on FortiGate according to the following mapping:
FortiAuthenticator settings
FortiGate settings
IdP entity ID Entity ID IdP single sign-onURL Assertion consumer service URL IdP single logout URL Single logout service URL The following demonstrates on FortiAuthenticator:
The following demonstrates on the FortiGate:
-
In the Certificate dropdown, select the IdP certificate that was imported on FortiGate.
-
Enter the following details in Additional SAML Attributes.
Attribute used to identify users username Attribute used to identify groups group -
Click Submit to save the changes.
To create SAML user group on FortiGate:
-
Go to User & Authentication > User Groups .
-
Click Create New.
-
Enter Name as SAML-FAC-Group.
-
In Remote Groups, click Add.
-
From the Remote Server dropdown, select saml-fac SAML server.
-
In the Groups field, click Specify and enter IT.
-
Click OK.
-
Click OK.
To associate SAML server with IPsec gateway interface:
Use FortiGate CLI to bind and associate the SAML server with the VPN gateway interface (port1) as follows:
config system interface edit "port1" set ike-saml-server "saml-fac" next end
Configuring SAML on IdP and SP is now complete. The next step is to use SAML configuration inside IPsec configuration. To configure IPsec, see Configuring IPsec IKEv2 on FortiGate.