<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: quest for the token (logging in to our agol using python) in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500867#M25256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake, thanks for that, i've set the parameters.&lt;/P&gt;&lt;P&gt;I just succeeded in using my own username/password to obtain some info from a feature service on my own agol, that's defenitely a step. Now I'm playing around with the result. Still a lot of python to be learned...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Apr 2016 14:15:28 GMT</pubDate>
    <dc:creator>Gisbert61</dc:creator>
    <dc:date>2016-04-13T14:15:28Z</dc:date>
    <item>
      <title>quest for the token (logging in to our agol using python)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500862#M25251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We use arcmap 10.3 and arcgis online. I want&amp;nbsp; to be able to download/backup&amp;nbsp; or upgrade hosted feature layers using python in order to automate our processes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The last couple of days have been an education ... unfortunately thus far I didn't graduate &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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, &lt;EM&gt;can anybody confirm this is correct? &lt;/EM&gt;There seem to be several ways to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, the good news: What Works At The Moment:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 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)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="code_demo_developers.PNG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/194550_code_demo_developers.PNG" style="width: 620px; height: 202px;" /&gt;&lt;/P&gt;&lt;P&gt;the response is first the token and second a lot of data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/194551_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;When I&amp;nbsp; 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:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/194603_Capture.PNG" style="width: 620px; height: 84px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As expected this id/secret does not have permissions to that feature layer. So far, so good!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for reading, thanks in advance for your replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2016 11:51:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500862#M25251</guid>
      <dc:creator>Gisbert61</dc:creator>
      <dc:date>2016-04-12T11:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: quest for the token (logging in to our agol using python)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500863#M25252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at the following tool for downloading a hosted feature service:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/docs/DOC-6496" target="_blank"&gt;Download ArcGIS Online Feature Service or ArcGIS Server Feature/Map Service&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within the tool includes code to generate a token.&amp;nbsp; Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;tokenURL = '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwww.arcgis.com%2Fsharing%2Frest%2FgenerateToken" target="_blank"&gt;https://www.arcgis.com/sharing/rest/generateToken&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;
&lt;SPAN&gt;params = {'f': 'pjson', 'username': username, 'password': password, 'referer': '&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fwww.arcgis.com" target="_blank"&gt;http://www.arcgis.com&lt;/A&gt;&lt;SPAN&gt;'}&lt;/SPAN&gt;
req = urllib2.Request(tokenURL, urllib.urlencode(params))
response = urllib2.urlopen(req)
data = json.load(response)
token = data['token']&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:59:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500863#M25252</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T21:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: quest for the token (logging in to our agol using python)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500864#M25253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jake,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got that tool but I don't get it. I've already posted some additional questions in that thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are at the end of our working day here in the Netherlands but I'll have a fresh attempt tomorrow morning &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2016 14:00:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500864#M25253</guid>
      <dc:creator>Gisbert61</dc:creator>
      <dc:date>2016-04-12T14:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: quest for the token (logging in to our agol using python)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500865#M25254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I use your toolbox in arcmap I can download a feature layer. When I try the script from a python IDE I can't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now the stack data reveils that url, username and password are set as expected, and I can see I do have a token but the error message is: URL is incorrect. Or, Service is secure, please enter username and password.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the same URL, username and password as I'm using in the toolbox. I do not understand why the toolbox works but the python script does not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the token valid for the url I'm trying to reach? Or should the token be generated elsewhere?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2016 11:25:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500865#M25254</guid>
      <dc:creator>Gisbert61</dc:creator>
      <dc:date>2016-04-13T11:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: quest for the token (logging in to our agol using python)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500866#M25255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The script has 10 total parameters, 7 of which are required.&amp;nbsp; If you do not set the required parameters, the script will fail.&amp;nbsp; The GP tool sets most of the parameters automatically using default values.&amp;nbsp; If you right-click on the GP tool in ArcMap &amp;gt; Properties &amp;gt; Parameters tab, you can scroll through each parameter to see which are required.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2016 11:54:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500866#M25255</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2016-04-13T11:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: quest for the token (logging in to our agol using python)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500867#M25256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jake, thanks for that, i've set the parameters.&lt;/P&gt;&lt;P&gt;I just succeeded in using my own username/password to obtain some info from a feature service on my own agol, that's defenitely a step. Now I'm playing around with the result. Still a lot of python to be learned...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2016 14:15:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500867#M25256</guid>
      <dc:creator>Gisbert61</dc:creator>
      <dc:date>2016-04-13T14:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: quest for the token (logging in to our agol using python)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500868#M25257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you ever get a solution to this? &amp;nbsp;I'm running into the same issue when trying to import his toolbox and run it via a script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2018 12:54:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500868#M25257</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-04-12T12:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: quest for the token (logging in to our agol using python)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500869#M25258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I realized that when the password string is passed in the loop, after each iteration it is replaced with "******". &amp;nbsp;It seems to work in a loop if the password string is entered as a variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2018 14:45:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500869#M25258</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-04-12T14:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: quest for the token (logging in to our agol using python)</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500870#M25259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Graham,&lt;/P&gt;&lt;P&gt;Sorry I only now see your post, I'm not a lot on geonet nowadays.&lt;/P&gt;&lt;P&gt;Yes, we've got it working. Did you succeed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2018 08:10:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quest-for-the-token-logging-in-to-our-agol-using/m-p/500870#M25259</guid>
      <dc:creator>Gisbert61</dc:creator>
      <dc:date>2018-07-23T08:10:38Z</dc:date>
    </item>
  </channel>
</rss>

