Created on
11-12-2024
08:33 AM
Edited on
03-13-2025
10:22 PM
By
Anthony_E
Description | This article describes how to enable the 'access_token' parameter in the URL for a FortiGate API request. |
Scope | FortiGate, REST API. |
Solution |
Starting from v7.4.5, API requests no longer allow the access_token as a URL parameter by default. This change aligns with security best practices to prevent sensitive information from being exposed and intercepted. Instead, the access_token must be included in the HTTP headers, as shown in the example below
[httpsd 2513 - 1739308886 info] fweb_debug_init[531] -- New GET request for "/api/v2/monitor/system/time" from "192.168.1.37:40424"
If using the access_token as a URL parameter is required, the configuration can be adjusted to enable it. The following commands allow this:
config system global set rest-api-key-url-query enable
Once this is enabled, the inclusion of access_token within URL parameters is allowed. However, as already mentioned, enabling this option should be carefully evaluated since it has the potential to expose the network to some risks. |