earthaccess icon indicating copy to clipboard operation
earthaccess copied to clipboard

[BUG] Login strategy not used

Open danielfromearth opened this issue 2 weeks ago • 2 comments

Is this issue already tracked somewhere, or is this a new report?

  • [x] I've reviewed existing issues and couldn't find a duplicate for this problem.

Have you checked the status of Earthdata services?

  • [x] I've executed earthaccess.status() and both CMR and EDL returned 'OK'.

Current Behavior

When I try to use strategy="interactive" for login, earthaccess does not present a prompt, but logs in using other strategies.

Expected Behavior

When executing earthaccess.login(strategy="interactive"), I expected it to present the input prompt, and not use environment or netrc strategies.

Steps To Reproduce

Here is what I see when I run this in a shell (I also see the same behavior in a Jupyter notebook):

>>> 
>>> import earthaccess
>>> earthaccess.__version__
'0.15.1'
>>> 
>>> import logging
>>> logging.basicConfig(level=logging.WARNING)
>>> specific_logger = logging.getLogger('earthaccess')
>>> specific_logger.setLevel(logging.DEBUG)
>>> 
>>> earthaccess.login(strategy="interactive", persist=False)
DEBUG:earthaccess:An error occurred during automatic authentication with strategy='environment': Either the environment variables EARTHDATA_USERNAME and EARTHDATA_PASSWORD must both be set, or EARTHDATA_TOKEN must be set for the 'environment' login strategy.
INFO:earthaccess.auth:You're now authenticated with NASA Earthdata Login
DEBUG:earthaccess.auth:Using token with expiration date: 01/20/2026
DEBUG:earthaccess.auth:Using .netrc file for EDL
DEBUG:earthaccess:Automatic authentication with strategy='netrc' was successful
DEBUG:earthaccess.auth:We are already authenticated with NASA EDL
<earthaccess.auth.Auth object at 0x1054c0620>

Environment

- OS: MacOS 15.7.2
- Python: 3.12.2

Additional Context

No response

danielfromearth avatar Dec 11 '25 20:12 danielfromearth