Skip to main content
tino_p
Staff
Staff
Oct 12, 2026 7:15 AM UTC

Technical Tip: How to use REST API to access FortiPAM when client connects to ZTNA

Description

This article describes the procedures to use REST API to access FortiPAM when the client connects to ZTNA

Scope

FortiPAM, ZTNA, EMS.

Solution

  1. In this setup, the client was connected to the EMS server. The objective is to use REST API (via the 'curl' command) to obtain the data from FortiPAM. 


ZTNA-client [10.47.3.70] ==== EMS-server [10.47.4.59] ==== [10.47.2.54] FortiPAM


0e6c2ae4.png


FortiPAM was also connected to the EMS server:

cb5b7abc.png


  1. In the Windows client, the correct syntax of CURL command is:


curl.exe --location "<address_path_of_FortiPAM_resource_here>" -H "Authorization: Bearer <token_here>" -k --cert "CurrentUser\MY\<Thumbprint>"


dc6325ad.png


  • The token code is generated when creating the API user in FortiPAM.

  • The certificate thumbprint is located in client certificate management.

0ca44c77.png


  1. In the Linux client, the pkcs11 tool needs to be installed to perform the cryptographic functions:

3.1 Download the FortiClient file with the .deb extension from the Fortinet Support Portal.

3.2 To install the newly downloaded FortiClient version:

sudo dpkg -i <forticlient file name.deb>
sudo apt install -f


3.3 Start FortiClient and connect to EMS:

forticlient gui


3.4 After that, install the 'pkcs11-tool':

sudo apt update
sudo apt install opensc opensc-pkcs11 pcscd
sudo apt install libengine-pkcs11-openssl


3.5 Check the cert:

pkcs11-tool --module /opt/forticlient/libcertd.so --list-slots



3.6, The correct syntax of CURL command is:

PKCS11_MODULE_PATH=/opt/forticlient/libcertd.so curl "<address_path_of_FortiPAM_resource_here>" -H "Authorization: Bearer <token_here>" -k --engine pkcs11 --cert 'pkcs11:object=fct-ztna-key;type=cert' --key 'pkcs11:object=fct-ztna-key;type=private'


3eb03978.png


  1. If the 'cert' is not included in the CURL command, the result will fail as follows:

044a20d8.png

    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024