I want to add Raster Layer WMS with extra query param: token=blablabla. And this token is credentials to GeoServer. When I do like in example - all is fine, layer is added to layer tree.

But then not work zoom in and out in QGIS in WMS, because QGIS not pass token to url in REQUEST=GetMap

rlayer = QgsRasterLayer(f"crs=EPSG:2180&dpiMode=4&format=image/png&layers=cities&styles&url=https://geoserver.local/api/v1/geoserver/wms&token={settings.token}", "Layer name", "wms")

How can I get always queryparam token in WMS requests to GeoServer?

  • https://geoserver.local/api/v1/geoserver/wms&token={settings.token} should be https://geoserver.local/api/v1/geoserver/wms?token={settings.token}
    – nmtoken
    Feb 9 at 14:41


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.