[GIS] Accessing a secure ArcGIS Server Map service from QGIS

arcgis-serverfeature-servicemap-serviceqgis

I am trying to access a map service my organization publishes for our customers from QGIS. The service is hosted in ArcGIS for Server 10.5 and is secured.

QGIS allows me to set up a connection, but when I try to connect, I get "The query returned no layers." The same service, if i change it to not be secured, will connect and the layers are able to be added to the map.

Has anyone else tried accessing a secured ArcGIS Server map service from QGIS? Most questions I see seem to be connecting to open services.

Best Answer

My team had this problem too. The issue is that ESRI uses token authentification for secure map services, and QGIS has no way to set up this token authentification.

We tried manually generating tokens (see https://enterprise.arcgis.com/en/server/10.3/administer/linux/acquiring-arcgis-tokens.htm) and adding the token key to the end of the map service URL eg. https://arcgis03.blabla.com:6666/arcgis/rest/services/BlablaCache/Nameofservice/MapServer?token=key

This did not work for a ArcGISMapServer connection in QGIS or for WMS/WMTS. It WOULD work for XYZ Tile eg. https://arcgis03.blabla.com:6666/arcgis/rest/services/blablaCache/Nameofservice/MapServer/WMTS/tile/1.0.0/Nameofservice/default/default028mm/{z}/{y}/{x}?token=key.

However XYZ Tile is limited to Web Mercator.

Since this was not practical for us, what we actually ended up doing is hosting a copy of the data on our private development server as well as the public secured service. I hope there is a better solution one day!

Related Question