Skip to main content
johnathan
Staff
Staff
May 9, 2026

Technical Tip: Using the FortiGate API to retrieve the RADIUS or TACACS+ secret key

  • May 9, 2026
  • 0 replies
  • 161 views

Description

This article describes how to recover the RADIUS or TACACS+ secret key via the FortiGate CLI.

Scope

FortiOS.

Solution

If the secret key for a RADIUS or TACACS+ server is forgotten, it is possible to view the decrypted form by querying the FortiGate's API.
The query will be done with '?plain-text-password=1', similar to what is done to see the IPsec PSK:
Technical Tip: Use the FortiGate API to recover an IPsec pre-shared key in plain text format.

The correct path to query for RADIUS would be as follows:


https://[FortiGate IP]/api/v2/cmdb/user/radius/[RADIUS server name]?plain-text-password=1


This is the output without '?plain-text-password=1', the secret is encrypted:


4cfba054.png


This is the output with '?plain-text-password=1', the secret is visible:


1bd41e70.png


The correct path to query for TACACS+ would be as follows:

https://[FortiGate IP]/api/v2/cmdb/user/tacacs+/[TACACS+server name]?plain-text-password=1


Encrypted output:


6d1a796e.png


Decrypted output:


915851d0.png


    Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
    Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.