AnsweredAssumed Answered

quest for the token (logging in to our agol using python)

Question asked by gisbert61 on Apr 12, 2016
Latest reply on Jul 23, 2018 by gisbert61

We use arcmap 10.3 and arcgis online. I want  to be able to download/backup  or upgrade hosted feature layers using python in order to automate our processes.

 

The last couple of days have been an education ... unfortunately thus far I didn't graduate

 

I understand now that I have to authenticate in order to get a token and use that token to get access to the feature layer, can anybody confirm this is correct? There seem to be several ways to do this?

 

First, the good news: What Works At The Moment:

 

     I cán use a client_id/client_secret I got after registering at developers.arcgis.com to access a hosted feature layer that is shared with everybody: (code from developers.arcgis.com, sorry didn't find a code tag)

code_demo_developers.PNG

the response is first the token and second a lot of data:

 

Capture.PNG

When I  try the same with a hosted feature layer that is only shared with a group local to my agol I get a neat response as well:

Capture.PNG

 

As expected this id/secret does not have permissions to that feature layer. So far, so good!

 

Now, my problem is how to use one of my 'local' arcgis online users to get access. For instance I have a user b.jansen_kdhl which only exists in kdhl.maps.arcgis.com. I want this user to be able to start a python script which updates a feature layer I've hosted on my arcgis online. The user as such has appropriate permissions.

 

How can I achieve to get a valid token for such a local agol user? Is there a specific tokenserver to use? Is the tokenserver/url a part of my own agol? Or am I barking up the wrong tree here?

 

Thanks for reading, thanks in advance for your replies.

 

regards,

 

Bert

Outcomes