Open sayatmimar opened 8 months ago
There's a UF auth layer required for the sandbox. You will need to pass a header with the name "Cookie" with the value of your auth from the browser window usually I get it from requests, similar to the image attached.
When I try to authenticate
girder_client
forsandboxathena
like this:gcd = girder_client.GirderClient( apiUrl='https://sandboxathena.rc.ufl.edu/api/v1') gcd.authenticate(apiKey='FrjZ4wnW1py6kFprhSB3XFMR6gqSXBlKeE8cEnaC')
I get the following error:
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/__init__.py", line 357, in loads return _default_decoder.decode(s) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "test.py", line 8, in <module> gcd.authenticate(apiKey='FrjZ4wnW1py6kFprhSB3XFMR6gqSXBlKeE8cEnaC') File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/girder_client/__init__.py", line 288, in authenticate resp = self.post('api_key/token', parameters={ File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/girder_client/__init__.py", line 478, in post return self.sendRestRequest('POST', path, parameters, files=files, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/girder_client/__init__.py", line 459, in sendRestRequest return result.json() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/requests/models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
This works for
athena
anddevathena instances
. Is there a fix for sandbox?