Skip to main content
npaiva
Staff & Editor
Staff & Editor
October 2, 2026

Technical Tip: Connect FortiIdentity Cloud to on-prem FortiGate for LDAP via ZTNA Tunnel

  • October 12, 2026 at 5:39 AM
  • 0 replies
  • 133 views

Description

This article describes how to connect FortiIdentity Cloud to an on-premises LDAP server for a user source via a ZTNA tunnel. The same configuration also applicable to LDAPS/StartTLS scenario.

76d6b30b.png

Scope

FortiIdentity Cloud, FortiOS.

Solution

Start by configuring the FortiOS ZTNA Access Proxy:

config firewall vip
    edit "ldapsrv"
        set type access-proxy
        set server-type https
        set extip 192.168.5.251
        set extintf "port1"
        set extport 42123
        set ssl-certificate "Fortinet_Factory"
    next
end


Note: If the FortiOS version is below 7.6.7, it is necessary to disable client certificates (set client-cert disable). In versions previous to version 7.6.7, FortiOS will always try to match the client Certificate with an EMS CA certificate, even if there is no EMS server configured on FortiOS.

As of versions 7.6.7 and 8.0.0, it is possible to opt out of using an EMS CA certificate with the following commands:

config authentication setting
    set ems-root-ca disable
    set user-cert-ca "Fortinet_CA"
end


The command ems-root-ca disable is self-explanatory, and for user-cert-ca the selected certificate should be the CA for the certificate presented by FIC when connecting to the access-proxy.

In this article, the default certificates on FIC are being used, so 'Fortinet_CA' is selected for 'set user-cert-ca'.

Continue configuring the access-proxy with TCP forwarding tunnel encryption:

config firewall access-proxy
    edit "ldapsrv"
        set vip "ldapsrv"
            config api-gateway
                edit 1
                    set url-map "/tcp"
                    set service tcp-forwarding
                        config realservers
                            edit 1
                                set address "ldaplab"
                                set mappedport 389
                                set tunnel-encryption enable
                          next
                        end
                    next
                end
            next
        end


Configure a ZTNA rule:

config firewall policy
    edit 3
        set name "fic-ldap"
        set srcintf "port1"
        set dstintf "any"
        set action accept
        set srcaddr "all"
        set dstaddr "ldapsrv"
        set schedule "always"
        set logtraffic all
        set nat enable
    next
end


On FortiIdentity Cloud, access Authentication -> Tunnel and configure the ZTNA tunnel:

3123f6c7.png


Next, create the User Source for LDAP under Authentication -> User Source. Fill in the necessary info under Source Information:

a26ae497.png


Configure the necessary information regarding the real server. Make sure to activate 'Connect via Tunnel' and select the previously created ZTNA tunnel:

cb6579ea.png


After the configuration is set up, test the ZTNA tunnel: go to Authentication -> Tunnel, select the three-dot icon of the tunnel, and select 'verify'.

Fill in the real server IP and port, and select the Verify button:

382b977e.png


It is also possible to test the user credentials by going to User Source -> Edit the LDAP server -> Interface Detail -> Test User Credentials:

d0ed3474.png


Traffic arriving at the real server:

892a4222.png


To configure the ZTNA tunnel directly from FortiAuthenticator Cloud, refer to Troubleshooting Tip: LDAP Connection through ZTNA tunnel from FortiAuthenticator Cloud fails with error 'Can't contact LDAP server'.

    Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
    Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
    Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT