New Token - Access HLS
-
- Posts: 6
- Joined: Mon Jan 15, 2024 11:05 am America/New_York
New Token - Access HLS
I have been using a script to download HLS data from a Python script using my earth data credentials stored in a .netcr file. My first token expired today, giving me this error message when trying to do a search:
RuntimeError: {"errors":["Token [Bearer eyJXXXE6LLQ] has expired. Note the token value has been partially redacted."]}
I generated a new toke, but I still get the same error. Do I need to change something in my credential file? Or does it just take a day to apply the change?
Thanks!
RuntimeError: {"errors":["Token [Bearer eyJXXXE6LLQ] has expired. Note the token value has been partially redacted."]}
I generated a new toke, but I still get the same error. Do I need to change something in my credential file? Or does it just take a day to apply the change?
Thanks!
Filters:
-
- User Services
- Posts: 420
- Joined: Mon Sep 30, 2019 10:00 am America/New_York
- Has thanked: 30 times
- Been thanked: 8 times
- Contact:
Re: New Token - Access HLS
Hi @cbourque17 It should not take a day to generate. If you haven't tried already, I recommend using the earthaccess package for an easy authentication or re-authentication. After installing and importing this package, runearthaccess.login(persist=True) function. This function will prompt for your NASA Earthdata username and password to create one if one does not exist and then uses your account information for authentication purposes. Thanks -- Danielle
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.
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.
Re: New Token - Access HLS
Also got this error recently and deleted my expired token so I couldn't investigate it further. It would seem that when making a request using someone's auth(email/passsword). If a token exists it uses it without checking if it has expired or not. Thus leading to the above error. Has someone investigated this? My current workaround is to refresh the token every day to ensure it never expires which I'm not too keen on!
Kind regards,
Joe Graham.
Kind regards,
Joe Graham.
-
- User Services
- Posts: 420
- Joined: Mon Sep 30, 2019 10:00 am America/New_York
- Has thanked: 30 times
- Been thanked: 8 times
- Contact:
Re: New Token - Access HLS
@j.graham have you tried setting up a refresh using earthaccess?
auth = earthaccess.login()
auth.refresh_tokens()
auth = earthaccess.login()
auth.refresh_tokens()
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.
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.