401 Error when Passing Credentials Resolved

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Locked
LP DAAC - jwilson
User Services
User Services
Posts: 266
Joined: Mon Sep 30, 2019 12:39 pm America/New_York
Answers: 1
Has thanked: 9 times

401 Error when Passing Credentials Resolved

by LP DAAC - jwilson » Mon Oct 24, 2022 1:07 pm America/New_York

Users have been experiencing 401 errors when trying to pass Earthdata Login authentication credentials to access data via scripts. The LP DAAC is pleased to report that this issue has been resolved. Users that were experiencing this error are encouraged to try their script again. If you are still experiencing a 401 error when attempting to download the data, please send a list of data products along with the data access script being used to download the data to LP DAAC User Services at lpdaac@usgs.gov.

Thank you for your patience while this issue was under review. LP DAAC apologizes for the inconvenience.
https://lpdaac.usgs.gov/news/401-error-when-passing-credentials-resolved/

Tags:

gatterr
Posts: 1
Joined: Thu Dec 07, 2023 3:48 pm America/New_York
Answers: 0

Re: 401 Error when Passing Credentials Resolved

by gatterr » Thu Dec 07, 2023 3:53 pm America/New_York

I had this problem, and was because I was not using the .netrc file to authenticate in the site ...

I need to create a .netrc file (is easy!) with my credentials and save in a specific place in my computer to stop to have this problem (I was using the module request to download the data)

I did this, and after that, I start to access the site without problem:

In my OS WINDOWS, I use the .netrc file without the underline (LIKE IN LINUX). And works without problem.

To create the archive I used notepad.

Inside the archive I put only the line:

machine <the_link_that_you_want> login <your_login> password <your_password>

like the example below:

machine www.gmail.com login maria password 123456

To save the file, I put in the name of the file : .netrc (otherwise, only the extension, without name at all) and in the type of file I mark: all files

I saved the archive in me personal directory (like C:/users/maria)

The directory must be the same directory that you have folders like: .vscode, .conda, .python ....

after that, the program start to authenticate in the site without problems.

LP DAAC - jwilson
User Services
User Services
Posts: 266
Joined: Mon Sep 30, 2019 12:39 pm America/New_York
Answers: 1
Has thanked: 9 times

Re: 401 Error when Passing Credentials Resolved

by LP DAAC - jwilson » Fri Dec 08, 2023 4:20 pm America/New_York

@gatterr Great advice! Thank you for the tip!
LP DAAC

Locked