I have a JS app that does a user login into AGOL (OAuth). If successful I want to call a python script that leverages Esri's ArcGIS Python API and manipulates content in the AGOL account. Problem is that the python is out of context so it needs to authenticate to AGOL too. I obviously don't want another login page and especially not a custom one, so how would I pass that security context over to the python code?
One approach I thought should have worked was in JS to grab the access token and then use that in the Python script. Problem is that the GIS class does not take a token as an argument:
class arcgis.gis.GIS(url=None, username=None, password=None, key_file=None, cert_file=None, verify_cert=True, set_active=True)
Any ideas how this might be accomplished?