Closed MarkusAlbrechtSWM closed 8 months ago
When calling QWC2 with start parameters in the URL, the parameters get lost if authentication is required.
For example, if QWC2 is called with the following start parameters:
https://qwc2-host/?c=688091.313644,5338424.983487&crs=EPSG:25832&s=500&l=Layer1,Layer2&hc=true
and authentication is required, a redirect to the following URL is sent:
https://qwc2-host/login?url=https://qwc2-host/?c=688091.313644,5338424.983487&crs=EPSG:25832&s=500&l=Layer1,Layer2&hc=true
Unpacking the URL in the qwc-oidc-auth-Module with target_url = request.args.get('url', tenant_base()) leads to the loss of all parameters except one.
target_url = request.args.get('url', tenant_base())
The cause of this problem is a missing URL encoding in the qwc-map-viewer's server.py at Line 80.
server.py
I suggest encoding request.url with urllib's urllib.parse.quote(request.url) to address this issue.
request.url
urllib.parse.quote(request.url)
Sorry for the late reply, missed the issue. Thanks for the report, fixed in https://github.com/qwc-services/qwc-map-viewer/commit/c42b7d1f17c10a91cbf3004c12cc400b131dbe33
When calling QWC2 with start parameters in the URL, the parameters get lost if authentication is required.
For example, if QWC2 is called with the following start parameters:
and authentication is required, a redirect to the following URL is sent:
Unpacking the URL in the qwc-oidc-auth-Module with
target_url = request.args.get('url', tenant_base())
leads to the loss of all parameters except one.The cause of this problem is a missing URL encoding in the qwc-map-viewer's
server.py
at Line 80.Suggested Fix
I suggest encoding
request.url
with urllib'surllib.parse.quote(request.url)
to address this issue.