Page 1 of 1

Confusing developer experience when download token expires

Posted: Tue Nov 26, 2024 10:23 am America/New_York
by matthew_cox_omnia
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

Re: Confusing developer experience when download token expires

Posted: Tue Nov 26, 2024 12:58 pm America/New_York
by steve_rogers56
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!

Re: Confusing developer experience when download token expires

Posted: Mon Dec 02, 2024 10:28 am America/New_York
by LP DAAC-EDL - dgolon
Hi @matthew_cox_omnia Thank you for providing that suggestion. I have passed it along to our developers.