vue-leaflet/Vue2Leaflet

WMS-tile-layer with auth header

Closed this issue · 2 comments

Hello, I am using vue2leaflet in a fairly large project and I need to load layers that have header base Authorization.
I've also tried leaflet plugin -> leaflet-wms-header, and I have set headers with auth for specific layers in the map object, but that header isn't sent to the server.
I use -> l-wms-tile-layer, to load layers.

Can someone advise me on how to set the auth header with base Authorization for layers?

Thanks.

Example: Error:

WMS:1 GET https://wms.cadastralwebmap.ch/WMS?service=WMS&request=GetMap&layers=cm_wms&styles=&format=image%2Fpng&transparent=true&version=1.1.1&upperCase=false&width=256&height=256&srs=EPSG%3A3857&bbox=844476.2884946273,5905830.553425856,845087.7847209087,5906442.049652142 401 (Unauthorized)

Versions

  • Leaflet: v1.6.0
  • Vue: v2.6.10
  • Vue2Leaflet: v2.1.1

@miko866 I think we did resolve this on discord, closing, feel free to re-open if necessary

muety commented

Which solution did you come up with? I'm interested as well.