Created on
11-12-2024
08:33 AM
Edited on
08-26-2025
01:04 AM
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"
In some cases, while attempting to connect to the FortiGate from FortiSOAR, the changes mentioned above may result in the following error message: 'Unauthorized. Wrong API key provided OR check user/VDOM/API key permission' as shown in the screenshot.
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. |
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.