Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EDL tokens not being revoked and regenerated as expected #764

Closed
mfisher87 opened this issue Jul 16, 2024 · 2 comments · Fixed by #782
Closed

EDL tokens not being revoked and regenerated as expected #764

mfisher87 opened this issue Jul 16, 2024 · 2 comments · Fixed by #782
Labels
enhancement New feature or request

Comments

@mfisher87
Copy link
Collaborator

mfisher87 commented Jul 16, 2024

First of all thanks for this library, it is very helpful for us! I have a question which is touching this issue. When we are doing earthaccess.search_data() we are login in via environment variables. So far so good, under https://urs.earthdata.nasa.gov/users/username/user_tokens we can see that two new tokens are created. I guess these are CMR Tokens? However, these tokens expire after 2 months and are not re-created and when we continue to use earthaccess we are getting RuntimeError('{"errors":["Token [Bearer eyJXXXI4SIQ] has expired. Note the token value has been partially redacted."]}'. This is solved by just deleting the Bearer Tokens, which triggers a re-creation.

Originally posted by @fwfichtner in #484 (comment)

Token regeneration is not automatic, actually is not part of the top level API. It could be automatic if we encounter an expired token, as of now one can do this:

import earthaccess

auth = earthaccess.login()

auth.refresh_tokens()

Originally posted by @betolink in #484 (comment)

To implement this, I think we need to look for this specific response from EDL and do a token refresh when we see it.

@fwfichtner
Copy link
Contributor

Thanks for opening this issue, I saw the part of the code you linked and wondered why that did not work as expected for us.
Are you able to reproduce the behaviour?

@mfisher87
Copy link
Collaborator Author

I haven't had the opportunity to try to reproduce yet. If someone else can help with reproduction, that'd be great! A lot on my plate at the moment :)

@mfisher87 mfisher87 added bug Something isn't working help wanted Extra attention is needed enhancement New feature or request and removed bug Something isn't working help wanted Extra attention is needed labels Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants