Created on
08-09-2024
06:31 AM
Edited on
05-01-2025
10:33 PM
By
Anthony_E
Description | This article describes how to recover an IPsec pre-shared key in plain text format using the FortiGate API. |
Scope | FortiGate. |
Solution |
Note: This article assumes that the admin has an IPsec tunnel set up with a pre-shared key defined, but has forgotten the actual plain text of that key. For demonstration purposes, this article will use a VPN tunnel with a pre-shared key of 'My_PSK'. Although the pre-shared key 'My_PSK' is known for this example, the focus is to help the admin recover the pre-shared key in plain text format.
Log in into the FortiGate GUI using the super_admin profile:
Open a new tab in the browser (such as Firefox or Google Chrome) and use the following path to obtain the PSK in plain text:
For all tunnels:
https://FortiGate_IP/api/v2/cmdb/vpn.ipsec/phase1-interface?plain-text-password=1
For a specific tunnel:
https://FortiGate_IP/api/v2/cmdb/vpn.ipsec/phase1-interface/TEST_S2S?plain-text-password=1
Important: |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.