[gdal-dev] gdalinfo and WMS: is there a way to pass credentials via CLI?

Even Rouault even.rouault at spatialys.com
Fri Feb 23 09:27:50 PST 2024


Hi,

I haven't tested but you should be able to use any of the env variable 
listed for CPLHTTPFetch() at 
https://gdal.org/api/cpl.html#_CPPv412CPLHTTPFetchPKc12CSLConstList

so here GDAL_HTTP_USERPWD

gdalinfo "WMS:http://wms.geobase.ca/wms-bin/cubeserv.cgi" --config 
GDAL_HTTP_USERPWD user:password

And probably that just incorporating it in the URL should work:

gdalinfo "WMS:http://user:password@wms.geobase.ca/wms-bin/cubeserv.cgi"

Even

Le 23/02/2024 à 18:05, andy via gdal-dev a écrit :
> Hi,
> is there a way to pass UserPwd parameter via a gdalinfo command?
> Is there a way to pass it, without creating an XML file?
>
> Something like this
>
> gdalinfo "WMS:http://wms.geobase.ca/wms-bin/cubeserv.cgi" 
> -UserPwd user:password
>
> Thank you
>
> -- 
> ___________________
>
> Andrea Borruso
> website: https://medium.com/tantotanto
> 38° 7' 48" N, 13° 21' 9" E, EPSG:4326
> ___________________
>
> "cercare e saper riconoscere chi e cosa,
>  in mezzo all’inferno, non è inferno,
> e farlo durare, e dargli spazio"
>
> Italo Calvino
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240223/9b060783/attachment.htm>


More information about the gdal-dev mailing list