EGA-archive / ega-download-client

A Python-based EGA download client
Apache License 2.0
93 stars 52 forks source link

Unable to login to account with two-factor authentication (OTP) #239

Open wna-se opened 3 weeks ago

wna-se commented 3 weeks ago

Unable to login to account with two-factor authentication (OTP)

When running pyega3 datasets and providing valid EGA credentials I get the following error message:

Used versions

To Reproduce

Activate two-factor authentication on the account and try to use the client.

Observed behaviour

Asked for username and password followed by an error about Invalid username, password or secret key

Expected behaviour

Being asked to provide OTP code in addition to password.

Screenshots and error messages

Invalid username, password or secret key - please check and retry. If problem persists contact helpdesk on helpdesk@ega-archive.org
Traceback (most recent call last):
  File "/opt/conda/lib/python3.11/site-packages/pyega3/libs/auth_client.py", line 39, in token
    r.raise_for_status()
  File "/opt/conda/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error:  for url: https://ega.ebi.ac.uk:8443/ega-openid-connect-server/token

Additional context

Looking at auth_client.py#L28 the required otp field seems to be missing. E.g., the function has not been implemented.

Edit: I can run pyega3 -t datasets and successfully list the test user’s (ega-test-data@ebi.ac.uk) datasets.

DexinYang1998 commented 3 weeks ago

We have encountered the same issue since last month.