Earthdata password pop up box

Hello! Is there anyway to enter our earthdata password programmatically rather than in the pop up box that is generated from earthdata_login?? I am trying to loop over some POIs and download available data. I do not want to have to enter my password for each specific region query if possible, but I couldn’t find a solution to this in slack or the documentation yet. Thanks for any help!!

2 Likes

Hey @kelseybisson
Yes. You can make a .netrc file and icepyx will use the credentials from there.

echo "machine urs.earthdata.nasa.gov login <uid> password <password>" >> ~/.netrc
chmod 0600 ~/.netrc

just replace <uid> and <password> with your NASA earthdata credentials and you should be good to go :+1:

3 Likes

Kelsey, NASA have some repos with some examples of using it - used one last year.

Ok, found where I had saved info:

https://git.earthdata.nasa.gov/projects/LPDUR

I believe Data_Download etc.

At EOSDIS, we provide a page with several programmatic examples in different languages using Earthdata Login here: Data Access - Earthdata Login - Earthdata Wiki

1 Like

@clynnes and others in the know. I’d love to know the roadmap for token-based access to NASA datasets across DAACs instead of using personal username and password. Temporary token-based access would be especially helpful for cloud-based workflows to avoid passing personal credentials or writing them to local .netrc files. It seems various NASA servers support “bearer tokens” in the HTTPS request headers, but not all servers support this, it very much depends on the dataset and host:

LAADS DAAC ( LAADS Data Download Scripts - LAADS DAAC)

The NASA Earthdata Login profile page has the option to generate tokens, but it’s unclear where and how to use them:

1 Like

Thanks for these resources, @clynnes. In this case, the [ICESat-2] data access is happening through icepyx, so storing the username and password as variables within a script isn’t a secure option. Currently we create an Earthdata session for each data order (so each session is associated with a Python object), but I’d be curious if there’s a way to pass sessions across objects so the user only needs to log in once (whether through a widget/boxed entry or .netrc file).

Along the lines of @scottyhq’s question, more information on token access would be awesome!

Over our next development period (now-early July), we’ll be making it easier to access direct S3 URLs (within region) and use authentication tokens. Part of that effort will include How-Tos. We are also in the process of migrating datasets to the cloud and enabling the S3 access for specific datasets.

We could use a beta tester or two to test-drive both the How-Tos and the overall UX ,ideally in the context of actual science workflows, albeit on a limited set of data.

2 Likes

I can help to beta test the authentication token workflow (and help incorporate it into icepyx at some point). As mentioned by Scott and Jessica above, the username/password combo has been a big pain point in certain cloud based and automated workflows, and as a science user, I’d be more than happy to proofread How-To docs and/or do User Acceptance Testing to get this up and running.

1 Like