protomaps-leaflet icon indicating copy to clipboard operation
protomaps-leaflet copied to clipboard

Adding basic authentication to http header with mvt

Open tisalmin opened this issue 11 months ago • 2 comments

Is there a way to add basic authentication to mvt requests as well? I can see in the examples it is done when fetching .pmtiles, but can it be done with e.g.

https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=1003762824b9687f (from example)

Passing the key in the url is not safe nor supported by the tile server we use. Thanks!

tisalmin avatar Jan 23 '25 19:01 tisalmin

Passing the key in the url is not safe

If you are using HTTPS then basic authentication should be as safe as passing the key in the URL.

Making this work in this library would require extending a bunch of internal APIs and maplibre gl js already does this, can you use that instead?

bdon avatar Jan 24 '25 04:01 bdon

There are few cases where HTTP headers are considered safer (e.g. browser cache), but I'll take a look at the options if it is not feasible to add it to this library. Thanks for the quick reply!

tisalmin avatar Jan 24 '25 05:01 tisalmin