Gaia authentication broken?
I'm persistently running into the issue that Gaia.login() appears to have no effect. The API still thinks I'm not logged in afterwards, and returns an error whenever I try to take an action that requires one to be authenticated. Below is a minimal example:
>> from astroquery.gaia import Gaia
Gaia.login()
INFO: Login to gaia TAP server [astroquery.gaia.core]
User: my_username
Password:
OK
INFO: Login to gaia data server [astroquery.gaia.core]
OK
>> Gaia.load_user('my_username')
403 Error 403:
User 'anonymous' is not authorized.
---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
<ipython-input-3-b080e926191a> in <module>
----> 1 Gaia.load_user('my_username')
~/.local/lib/python3.10/site-packages/astroquery/gaia/core.py in load_user(self, user_id, verbose)
748 """
749
--> 750 return self.is_valid_user(user_id=user_id,
751 verbose=verbose)
752
~/.local/lib/python3.10/site-packages/astroquery/utils/tap/core.py in is_valid_user(self, user_id, verbose)
1228 print(response.status, response.reason)
1229 print(response.getheaders())
-> 1230 connHandler.check_launch_response_status(response,
1231 verbose,
1232 200)
~/.local/lib/python3.10/site-packages/astroquery/utils/tap/conn/tapconn.py in check_launch_response_status(self, response, debug, expected_response_status, raise_exception)
681 errMsg = taputils.get_http_response_error(response)
682 print(response.status, errMsg)
--> 683 raise requests.exceptions.HTTPError(errMsg)
684 else:
685 return isError
HTTPError: Error 403:
User 'anonymous' is not authorized.
Somehow, the login is not "sticky." Is this a problem with astroquery, with the Gaia Archive, or with something else?
Hi @gregreen,
I cannot reproduce the issue:
>>> import astroquery
>>> astroquery.__version__
'0.4.12.dev10370'
>>> from astroquery.gaia import Gaia
>>> Gaia.login()
INFO: Login to gaia TAP server [astroquery.gaia.core]
User: jferna
Password:
INFO: OK [astroquery.utils.tap.core]
INFO: Login to gaia data server [astroquery.gaia.core]
INFO: OK [astroquery.utils.tap.core]
>>> Gaia.load_user('my_username')
False
>>> Gaia.load_user('jferna')
True
>>> Gaia.load_user('fake')
False
I checked my astroquery version:
>>> astroquery.__version__
'0.4.6'
I upgraded to 0.4.11, and suddenly the above error disappears. So it appears that this was a problem with earlier versions of astroquery.
Great new!