Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable libcurl cookie engine #1000

Closed
idixon opened this issue Oct 11, 2018 · 2 comments
Closed

Enable libcurl cookie engine #1000

idixon opened this issue Oct 11, 2018 · 2 comments

Comments

@idixon
Copy link

idixon commented Oct 11, 2018

We would like libcurl in gdal to enable the cookie engine. The files we are trying to access with /vsicurl/ have a redirect auth in front of them. Without the cookie engine enabled the auth cookie is never forwarded and the requests fail.

We confirmed this is possible by adding:

curl_easy_setopt(http_handle, CURLOPT_COOKIEFILE, "");

to cpl_http.cpp in version 2.3.2.

As an additional feature it would be great to have the COOKIEFILE and COOKIEJAR options exposed to the user.

@asjohnston-asf
Copy link

Fulfilling this enhancement request would allow vsicurl requests against files protected by single-sign-on authentication. In particular, NASA's earth science mission data are hosted behind authentication administered by https://urs.earthdata.nasa.gov . vsicurl already supports redirects and netrc credentials, but also needs libcurl's cookie engine enabled to support the single-sign-on workflow. Enabling the cookie engine internally, or allowing users to override the CURLOPT_COOKIEFILE and CURLOPT_COOKIEJAR libcurl options at runtime, would allow gdal users to interact with these data sets directly over the web.

NASA Earth Observation Data - https://earthdata.nasa.gov/earth-observation-data
NASA Earthdata Login SSO - https://earthdata.nasa.gov/about/science-system-description/eosdis-components/earthdata-login

@scottyhq
Copy link
Contributor

scottyhq commented Dec 5, 2018

This would be great to get into the next release since it just seems to require a few environment variables and will open up a lot of useful archived datasets! I'll follow up with a pull request.

Thanks for finding a solution and bringing this up @asjohnston-asf and @idixon !

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

No branches or pull requests

4 participants