Confusing developer experience when download token expires

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
matthew_cox_omnia
Posts: 21
Joined: Thu Sep 21, 2023 4:40 pm America/New_York
Answers: 0
Has thanked: 2 times
Been thanked: 1 time

Confusing developer experience when download token expires

by matthew_cox_omnia » Tue Nov 26, 2024 10:23 am America/New_York

Hi LP-DAAC friends-
I wanted to inform you of some confusing behavior that I believe occurs when a download token expires so that you can consider opportunities to improve the process and have fewer support requests.

Here's my scenario - I've got a script that runs daily to get results from the VIIRS NRT service and it uses a download token to do so. It suddenly started throwing the following error:

Code: Select all

HTTPStatusError: Redirect response '303 See Other' for url 'https://nrt3.modaps.eosdis.nasa.gov/api/v2/content/archives/allData/5200/VNP21_NRT/Recent/VNP21_NRT.A2024329.0000.002.2024329025227.nc'
Redirect location: '/profiles/licenses/api/v2/content/archives/allData/5200/VNP21_NRT/Recent/VNP21_NRT.A2024329.0000.002.2024329025227.nc'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303
Several things that were confusing:
1. I checked out the original link in my browser and it downloaded the file in question, which is unhelpful in debugging as it doesn't produce the same behavior.
2. I got my script to print out the HTML of the redirect URL and it appears to be the Earthdata Login screen. I'm confused under what circumstances this would be useful behavior because if one is using a download token, I'd assume that the interaction is scripted, there's no opportunity to recover and log in.
3. As a user of this service, a 403 with an error message that the download token is expired would be more helpful than redirecting as it would inform me of the root of the problem.
4. I suspected that my download token was expired, but was confused when I went to the download token page as the only token present said that it expires 2025-01-25, which indicates that it's valid.
5. I generated a new token, and it refreshed the page and showed two tokens, both of which had the 2025-01-25 expiration date. There was no way to distinguish which was the old token and the new token unless you had the old token saved somewhere for comparison. I assume that the expiration date on the old one was untrue, but it also leads me to question all expiration dates on these tokens.
6. As far as I can tell, we did not receive an automated email indicating that the download token was going to expire soon.

I've got the script up and running again, so no action necessary on your part but figured that you'd value hearing about these rough edges. I'd be happy to discuss further if you'd like!

Matthew

Filters:

steve_rogers56
Posts: 2
Joined: Tue Nov 26, 2024 12:50 pm America/New_York
Answers: 0

Re: Confusing developer experience when download token expires

by steve_rogers56 » Tue Nov 26, 2024 12:58 pm America/New_York

Matthew,

The issue seems rooted in the expired download token behavior and unclear error handling. Key suggestions:

Use a 403 error with an "expired token" message instead of a 303 redirect to the login page.
Provide clear token expiration info on the token management page.
Automate expiration reminders via email.
Glad you resolved it—thanks for sharing!

LP DAACx - dgolon
User Services
User Services
Posts: 422
Joined: Mon Sep 30, 2019 10:00 am America/New_York
Answers: 0
Has thanked: 31 times
Been thanked: 8 times
Contact:

Re: Confusing developer experience when download token expires

by LP DAACx - dgolon » Mon Dec 02, 2024 10:28 am America/New_York

Hi @matthew_cox_omnia Thank you for providing that suggestion. I have passed it along to our developers.
Subscribe to the LP DAAC listserv by sending a blank email to lpdaac-join@lists.nasa.gov.

Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.

Post Reply