arcGIS Hub login

108
0
05-17-2021 02:51 AM
CliveSwan
Occasional Contributor II

Greetings,

I am tring to loginto ArcGIS Hub and get a token to use to access data.

The code is:

referer  = 'https://org-data-hub-org.hub.arcgis.com'
AGOL =  referer

AGOL=GIS(AGOL, username, password, ssl=False)
token = arcpy.GetSigninToken()['token']
token = token.rstrip(".")

print(token)

 

The error appears not to return a token?? Any pointers to get a token to use with the DataHub??

Any pointers appreciated.

Thanks,

Clive

JSONDecodeError                           Traceback (most recent call last)
In  [21]:
Line 50:    AGOL=GIS(AGOL, username, password, ssl=False)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py, in __init__:
Line 359:   raise e

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py, in __init__:
Line 343:   trust_env=kwargs.get("trust_env", None))

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_portalpy.py, in __init__:
Line 173:   self.get_properties(True)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_portalpy.py, in get_properties:
Line 1138:  raise e

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_portalpy.py, in get_properties:
Line 1126:  resp = self.con.post(path, self._postdata(), ssl=True)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in post:
Line 632:   elif token_as_header == False and self.token is not None: #as ?token=

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in token:
Line 1038:  self._token = self._enterprise_token()

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in _enterprise_token:
Line 1155:  add_token=False)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in post:
Line 720:   force_bytes=kwargs.pop('force_bytes', False))

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in _handle_response:
Line 500:   data = json.loads(data)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\json\__init__.py, in loads:
Line 348:   return _default_decoder.decode(s)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\json\decoder.py, in decode:
Line 337:   obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\json\decoder.py, in raw_decode:
Line 355:   raise JSONDecodeError("Expecting value", s, err.value) from None

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

 

 

Tags (3)
0 Kudos
0 Replies