Skip to main content
cmaheu
Staff
Staff
February 4, 2026

Technical Tip: Configure FortiGate v7.4.5+ / v7.6.1+ to allow access_token in URL Parameters from FortiNAC v7.4.3+

  • February 4, 2026
  • 0 replies
  • 1231 views
Description

This article describes how to enable the 'access_token' parameter in the URL for a FortiGate API request as a work-around to avoid API key being removed from FortiNAC.

 

Starting from FortiGate FortiOS v7.4.5 and 7.6.1, API requests no longer allow the access_token as a URL parameter by default. Consequently, FortiNAC will fail to update ports/switch VLANs on a FortiSwitch in FortiLink mode. When this occurs, the API key is removed from the FortiGate device model in FortiNAC.

 

Affects non-RADIUS-enabled FortiSwitch ports where FortiNAC relies on APIs to make changes.

 

Example of behavior:

  1. Navigate to Network -> Inventory and add the FortiGate.
  2. Right-click the FortiGate device model and select Model Configuration.
  3. Enter API key generated by FortiGate in the Fortigate API Token field.
  4. Navigate back to Inventory.
  5. Right-click the FortiGate device model and select Resync Interface a couple times.
  6. Once the FortiSwitch ports are displayed in the Ports view, double click on a port to display the Port Properties window.
  7. Change the VLAN id in the Current VLAN to the desired VLAN id and select OK.
  8. Display the Model Configuration page again and the FortiGate API Token field is now empty.

 

The following messages are also seen in the output.master file:

 

Fortigate.switchPortVlanMS_API VLAN API failed for port 366

Fortigate.switchPortVlanMS_API port state API failed

Fortigate.switchPortVlan returning false

Scope FortiGate FortiOS v7.4.5+ / 7.6.1+, FortiNAC vF 7.4.3+ & vF 7.6.5+. REST API.
Solution

If using the access_token as a URL parameter is required, the configuration can be adjusted to enable it.

 

Note: Enabling 'rest-api-key-url-query' in FortiGate should be carefully evaluated since it has the potential to expose the network to some risks.

 

Configure FortiGate:

  1. Configure the FortiGate to allow the inclusion of access_token within URL parameters. In the FortiGate CLI, enter the following configuration:

 

config system global

    set rest-api-key-url-query enable

end

 

  1. Navigate to System -> Administrators and double-click on the REST API Administrator used in FortiNAC.
  2. In the API key, select Regenerate. Copy the key to the buffer.

 

FortiNAC:

  1. Copy and paste the new API key in FortiNAC's Model Configuration page again. 
  2. Click on Save.
  3. Changing the port VLAN should now be successful and the API key should not be removed from FortiNAC.

 

Related article:

Technical Tip: Configuring FortiGate v7.4.5+/v7.6.1+ to Allow access_token in URL Parameters

    Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
    Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.