website/integrations/networking/fortigate-admin/index.md
FortiGate is a firewall from Fortinet. It is an NGFW with layer 7 inspection and can become part of a Fortinet security fabric.
-- https://www.fortinet.com/products/next-generation-firewall
The following placeholders are used in this guide:
fortigate.company is the FQDN of the FortiGate installation.authentik.company is the FQDN of the authentik installation.:::info This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application. :::
To support the integration of FortiGate with authentik, you need to create an application/provider pair in authentik.
usernamereturn request.user.emailhttps://fgt.company/saml/?acs.https://authentik.company.https://fgt.company/metadata.Post.To integrate FortiGate with authentik, navigate to https://fortigate.company/ng/system/certificate and import the certificate you configured in the previous section.
Once that is done, navigate to https://fortigate.company/fabric-connector/edit/security-fabric-connection and select Single Sign-On to configure SAML authentication. You should see, under Mode, a toggle named Service Provider (SP), toggle it to enable this authentication method.
Then, set the following values in the FortiGate administrative UI:
fortigate.companyNormal or Single Sign-On, depending on your needs. Normal allows local and SAML authentication while the latter only allows SAML authentication.Under IdP Details, set the following values:
httpsCustomhttps://authentik.companyhttps://authentik.company/application/saml/<application_slug>/sso/binding/redirect/https://authentik.company/application/saml/<application_slug>/slo/binding/redirect/FortiGate creates a new user by default if one does not exist, so you will need to set the Default Admin Profile to the permissions you want any new users to have. (I have created a no_permissions profile to assign by default.)
Under SP Details set the SP entity ID to https. Note it for later use (this is your Audience value of the authentik SP-provider).
IdP Type to CustomIdP entity ID to https://authentik.companyIdP Login URL to https://authentik.company/application/saml/<application_slug>/sso/binding/redirect/IdP Logout URL to https://authentik.company/application/saml/<application_slug>/slo/binding/redirect/IdP Certificate to ak.certThese are just suggestions of what could be the cause of an issue and how to enable debug on the FortiGate.
Enabling debug on the FortiGate You can use the following commands on the FortiGate to enable debugging:
Debug saml daemon
This will provide all possible output from the SAML daemon.
diag debug application samld -1
Enable debug timestamps (optional)
diagnose debug console timestamp enable
Enabling debug output
Before you can see any output you need to enable the debug mode.
diagnose debug enable
If you used SSO Login only instead of Normal and you are not able to log in again, you can try one of the following methods:
Method 1:
Open this URL (https://fortigate.company/saml/?acs) in a browser and choose Login Locally.
Method 2: Open the CLI and set the login page back to normal.
config system saml
set default-login-page normal
end
To confirm that authentik is properly configured with FortiGate Admin Login, log out and attempt to log back in using SAML authentication through authentik.