Certificate-based MFA on Fortigate
Goal
Require a valid user certificate for SSL-VPN users in a specific AD group.
Prerequisites
Have already deployed certificates to your users via ADCS. If not, follow Deploying user certificates within Active Directory.
Have configured LDAP authentication based on your Active Directory.
Import the root CA into FortiGate
Import your CA root certificate in System → Certificates → Create/Import → CA Certificate.


For clarity, we recommend renaming the imported certificate (by default named Ca_Cert_X where X is a number) to a more meaningful name. To do so, open the FortiGate command line interface and enter the following commands:
config vpn certificate ca
rename Ca_Cert_X to ADCS_CertThe certificate should then appear under its new name.

Create a user peer (PKI) that ties the cert to LDAP
You’ll reference this user peer from your SSL-VPN authentication rule.
Replace:
ADCS_Certwith your imported CA name (the rename above).<LDAP_SERVER_NAME>with the FortiGate LDAP server object name from User & Authentication → LDAP Servers.
config user peer
edit pki01
set ca ADCS_Cert
set ldap-server <LDAP_SERVER_NAME>
set ldap-mode principal-name
next
endconfig user peer
edit pki01
set ca ADCS_Cert
set mfa-mode subject-identity
set mfa-server <LDAP_SERVER_NAME>
next
endCreate an AD group for certificate users
To facilitate MFA deployment among your employees, we recommend creating a new Active Directory group. This will allow you to gradually migrate users from the "VPN without certificate" group to the "VPN with certificate" group. Create this new group in your Active Directory domain using the "Active Directory Users and Computers" tool. In the example below, we named it "NOMADE_CERT":


Map the user group to your SSL-VPN portal
In SSL-VPN Settings, map the new group to the portal you want.

Open the FortiGate CLI again and enter the following command:
conf vpn ssl settings
conf authentication-rule
showThe list of existing mappings should then be displayed, as in the example below:

You must now identify the newly created mapping. In this example, it is number 4, associated with the group NOMADE_CERT.
Enter the following commands (replace 4 with your mapping ID):
edit 4
set client-cert enable
set user-peer pki01
end
showYou should then see the updated list of mappings:

Users in the AD domain who belong to NOMADE_CERT must now present a valid user certificate to connect.
Troubleshooting authentication issues
The following commands will allow you to view debug logs for LDAP and authentication processes in general (the commands must be entered in the FortiGate CLI, and the session must remain open):
diagnose debug enable
diagnose debug application fnbamd -1
diagnose debug application authd -1
diagnose debug application ldap -1If the above commands do not help identify the issue (incorrect information in the certificate, LDAP server unreachable, etc.), it may be useful to enable SSL VPN debug logging:
diagnose debug app sslvpn -1
diagnose vpn ssl debug-filter src-addr4 XXX.XXX.XXX.XXXTo limit the amount of displayed logs, replace XXX.XXX.XXX.XXX above with the source IP address initiating the VPN connection.
Once debugging is complete, you must disable debug mode:
Please note that this procedure can be somewhat complex, as it requires being simultaneously connected to the FortiGate and able to launch FortiClient. Do not hesitate to contact our experts if necessary.
Was this helpful?






