Skip to content

Update wmsLayer.ts#9

Draft
lk-bs wants to merge 1 commit into
virtualcitySYSTEMS:release-v6.3from
lk-bs:lk-bs-patch-1
Draft

Update wmsLayer.ts#9
lk-bs wants to merge 1 commit into
virtualcitySYSTEMS:release-v6.3from
lk-bs:lk-bs-patch-1

Conversation

@lk-bs

@lk-bs lk-bs commented Jun 4, 2026

Copy link
Copy Markdown

bei wms dienst mit basic authentication wird der konfigurierte authorization header nur bei getcapabilities mitgesendet. bei Getmap und GetLegendGraphic anfragen wird er nicht mitgeschickt

@jbo023

jbo023 commented Jun 4, 2026

Copy link
Copy Markdown
Member

@lk-bs

lk-bs commented Jun 5, 2026

Copy link
Copy Markdown
Author

Okay I see, thanks for the fast response. I still can't figure out the problem why i can't integrate a protected wms service with basic authentication. No map tiles are rendered, and no GetMap request error appears in the browsers's Network tab.
I tried a direct fetch() call with the authorization header that returns a valid PNG tile and the image is visible in the browser preview.
The only visible error is a 401 on the GetLegendGraphic, which I understand is a separate issue right?

Does VC Map support sending custom headers such as authorization when loading wms tiles?

URL:
https://urbangreeneye.lup-umwelt.de/wms2.php?SERVICE=WMS&REQUEST=GetCapabilities

WMS layers:
Vegetationshoehe

WMS parameters:
UGE%3AVEGETATIONSHOEHE=

Header:
{"Authorization": "Basic dWdlX2JyYXVuc2Nod2VpZzpZU25BMSxzLDc6N1k="}

fetch:
fetch("https://urbangreeneye.lup-umwelt.de/wms2.php?SERVICE=WMS&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Vegetationshoehe&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&STYLES=&BBOX=10.634765625,52.294921875,10.8544921875,52.3828125", {
headers: {"Authorization": "Basic dWdlX2JyYXVuc2Nod2VpZzpZU25BMSxzLDc6N1k="}
})
.then(r => console.log(r.status))
.catch(e => console.error(e))

@jbo023

jbo023 commented Jun 5, 2026

Copy link
Copy Markdown
Member

Hi, can you send me the credentials via message, or email, than i can take a quick look. A WMS Service should work with defined headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants