[gdal-dev] OGC services and credentials
Michał Kowalczuk
michkowalczuk at gmail.com
Tue Oct 29 05:53:56 PDT 2024
Hi GDAL friends!
Why service credentials (username & password) can not be entered with open
options (*-oo UserPwd=user:pass*) when working with OGC services (tested
against WMS)?
I know there is a config option *GDAL_HTTP_USERPWD=value* but it's not
clean solution in my opinion. Credential should be related to and owned by
the dataset not the global environmental variable. What if I use more than
one services that need credentials?
I know there is a "UserPwd" XML tag when using xml as an open path, but
this limits the use of other open methods (
https://gdal.org/en/latest/drivers/raster/wms.html#xml-description-file).
So, the following returns dataset info
*gdalinfo "WMS:sample_wms_service?request=getcapabilities&service=wms"
--config GDAL_HTTP_USERPWD=user:pass*
and the following:
*gdalinfo "WMS: sample_wms_service?request=getcapabilities&service=wms" -oo
UserPwd=user:pass*
returns error:
*ERROR 1: HTTP error code : 401ERROR 1: Error returned by server : HTTP
error code : 401 (0)gdalinfo failed - unable to open* ...
Unfortunately, I can not share the sample service and it's credentials, but
it is not needed for answer my general question.
Thank you in advance for your interest in the problem
Michał Kowalczuk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20241029/c6fa29d6/attachment.htm>
More information about the gdal-dev
mailing list