I have been trying to consume a protected ArcGIS Map Service in QGIS 3.28.3, using "ESRI token" authentication mode.
If the secured map service is exposed by ArcGIS Online, QGIS is able to do an ArcGIS REST Servers connection and then to successfully load the service into the map.
In order to get ArcGIS Online Token, I have used method 1 suggested within this document:
On ArcGIS Enterprise 11.0 environment, instead, QGIS is not able to consume a protected ArcGIS Map Service using "ESRI token" authentication mode.
Either generating token on ArcGIS Enterprise base deployment with a federated ArcGIS Server or on an ArcGIS Server standalone, QGIS returns an error when trying to connect to ArcGIS REST Servers:
Connection failed: Error 498 Invalid Token
In this case I have generated token in the following way:
Generating Token By URL Request From ArcGIS Portal?
Is there a way in QGIS to correctly consume a secured ArcGIS Enterprise service?