<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>The mention to _netrc is weird...<br>
</p>
<p>Regarding authentication issues, this service is quite annoying
and requires enabling cookies. See
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/pipermail/gdal-dev/2021-October/054728.html">https://lists.osgeo.org/pipermail/gdal-dev/2021-October/054728.html</a></p>
<p>You need to add things like <i>--config GDAL_HTTP_COOKIEFILE
/tmp/cookies.txt --config</i><i> GDAL_HTTP_COOKIEJAR
/tmp/cookies.txt</i></p>
<div class="moz-cite-prefix">Le 05/10/2021 à 18:20, Joaquim Manuel
Freire Luís a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:AM6PR04MB3959C81EC2E778F57FBB2A46A6AF9@AM6PR04MB3959.eurprd04.prod.outlook.com">
<pre class="moz-quote-pre" wrap="">OK, tried more things from that thread.
gdalinfo /vsicurl/<a class="moz-txt-link-freetext" href="https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T10TEK.2021192T184511.v2.0/HLS.L30.T10TEK.2021192T184511.v2.0.B04.tif">https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSL30.020/HLS.L30.T10TEK.2021192T184511.v2.0/HLS.L30.T10TEK.2021192T184511.v2.0.B04.tif</a> --config GDAL_DISABLE_READDIR_ON_OPEN EMPTY_DIR --config CPL_CURL_VERBOSE ON --config CPL_VSIL_CURL_USE_HEAD FALSE
* Couldn't find host data.lpdaac.earthdatacloud.nasa.gov in the _netrc file; using defaults ...
OK, right it's not there.
But latter down it says
* Couldn't find host urs.earthdata.nasa.gov in the _netrc file; using defaults
Now this is not right.
< HTTP/1.1 401 Unauthorized
...
< WWW-Authenticate: Basic realm="Please enter your Earthdata Login credentials. If you do not have a Earthdata Login, create one at <a class="moz-txt-link-freetext" href="https://urs.earthdata.nasa.gov//users/new">https://urs.earthdata.nasa.gov//users/new</a>"
...
ERROR 11: HTTP response code: 401
So I'm back to the Authentication problem. I do have an _netrc file (and .netrc btw) in my home dir as well as current dir but it does seem to find it. Is there something else that I must to in order to that file be found/used?
-----Original Message-----
From: thomas bonfort <a class="moz-txt-link-rfc2396E" href="mailto:thomas.bonfort@gmail.com"><thomas.bonfort@gmail.com></a>
Sent: Tuesday, October 5, 2021 4:31 PM
To: Joaquim Manuel Freire Luís <a class="moz-txt-link-rfc2396E" href="mailto:jluis@ualg.pt"><jluis@ualg.pt></a>
Subject: Re: [gdal-dev] How to access remote data that requires authentication?
for the 206 there seems to be a similar issue posted here a few days ago, search for "Problem accessing NASA Cloud Optimized GeoTIFF data"
in the archives
On Tue, Oct 5, 2021 at 5:26 PM Joaquim Manuel Freire Luís <a class="moz-txt-link-rfc2396E" href="mailto:jluis@ualg.pt"><jluis@ualg.pt></a> wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
you should also change your password, now you have posted it on a
public mailing list :/
Shit, thanks for spotting it.
But it doesn't work with /vsicur/ neither (had tried it before). Now
the error is 206
gdalinfo
/vsicurl/<a class="moz-txt-link-freetext" href="https://user:pass@lpdaac.earthdata.nasa.gov/lp-prod-protected">https://user:pass@lpdaac.earthdata.nasa.gov/lp-prod-protected</a>
/HLSS30.015/HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif
ERROR 11: HTTP response code: 206
On Tue, Oct 5, 2021 at 5:12 PM Joaquim Manuel Freire Luís <a class="moz-txt-link-rfc2396E" href="mailto:jluis@ualg.pt"><jluis@ualg.pt></a> wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
Hi,
I’ve read a lot of the docs, tried many -co options but can’t get through this mystery.
I can access the data through GMT, which uses GDAL to do this job,
but can’t do it with GDAL directly
gdalinfo
<a class="moz-txt-link-freetext" href="https://user:pass@lpdaac.earthdata.nasa.gov/lp-prod-protected/HLSS30">https://user:pass@lpdaac.earthdata.nasa.gov/lp-prod-protected/HLSS30</a>
.0 15/HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif
ERROR 1: HTTP error code : 401
gdalinfo failed - unable to open '<a class="moz-txt-link-freetext" href="https://jluis:abaixo0Earthdata@lpdaac.earthdata.nasa.gov/lp-prod-protected/HLSS30.015/HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif">https://jluis:abaixo0Earthdata@lpdaac.earthdata.nasa.gov/lp-prod-protected/HLSS30.015/HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif</a>'.
So passing longin:password via url does not work either. But it does
if indirectly used
grdinfo
<a class="moz-txt-link-freetext" href="https://user:pass@lpdaac.earthdata.nasa.gov/lp-prod-protected/HLSS30">https://user:pass@lpdaac.earthdata.nasa.gov/lp-prod-protected/HLSS30</a>
.0 15/HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif
HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif: Title: Grid imported via
GDAL
HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif: Command:
HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif: Remark:
HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif: Pixel node registration
used [Cartesian grid]
HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif: Grid file format: gd =
Import/export through GDAL
HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif: x_min: 499980 x_max:
609780 x_inc: 30 name: x n_columns: 3660
HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif: y_min: 4390200 y_max:
4500000 y_inc: 30 name: y n_rows: 3660
HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif: v_min: -0.0149 v_max:
0.8833 name: z
HLS.S30.T10TEK.2020273T190109.v1.5.B8A.tif: scale_factor: 0.0001
add_offset: 0 packed z-range: [-149,8833]
+proj=utm +zone=10 +ellps=WGS84 +units=m +no_defs
Joaquim
_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
</blockquote>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>