Hi Dan, I noodled around with this a bit. Not sure how this would work. I did note that if I put in bogus credentials, I get back an error that it cannot generate a token (which makes sense). I guess my question is still how would I skip the user/pass checking if I already have a token that was supplied?
>>> from arcgis.gis import GIS
>>> gis = GIS('https://xxx.maps.arcgis.com/', username='xxx', password='xxx')
Unable to generate token.
Invalid username or password.
Traceback (most recent call last):
File "C:\Python36\lib\site-packages\arcgis\gis\__init__.py", line 257, in __init__
client_id=self._client_id)
File "C:\Python36\lib\site-packages\arcgis\_impl\portalpy.py", line 163, in __init__
client_id=client_id)
File "C:\Python36\lib\site-packages\arcgis\_impl\connection.py", line 284, in __init__
self.login(username, password, expiration, client_id)
File "C:\Python36\lib\site-packages\arcgis\_impl\connection.py", line 532, in login
newtoken = self.generate_token(username, password, expiration, client_id)
File "C:\Python36\lib\site-packages\arcgis\_impl\connection.py", line 397, in generate_token
ssl=True, add_token=False)
File "C:\Python36\lib\site-packages\arcgis\_impl\connection.py", line 1129, in post
self._handle_json_error(resp_json['error'], errorcode)
File "C:\Python36\lib\site-packages\arcgis\_impl\connection.py", line 1149, in _handle_json_error
raise RuntimeError(errormessage)
RuntimeError: Unable to generate token.
Invalid username or password.
(Error Code: 400)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Python36\lib\site-packages\arcgis\gis\__init__.py", line 264, in __init__
raise RuntimeError(e.args)
RuntimeError: ('Unable to generate token.\nInvalid username or password.\n(Error Code: 400)',)