Select to view content in your preferred language

How to do portal identity delegation from JS into Python

646
0
06-20-2017 03:57 PM
JonUjkani
Deactivated User

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?

Thanks.

0 Kudos
0 Replies