<?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: Why does token-based security work for AGOL but not for AGEnt? in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258606#M1259</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI I opened a case with Esri tech support - which is still open. The analyst managed to recreate the issue; now I'm trying to convince them that this is a bug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also FYI we're doing the same exercise with SharePoint Online vs. SharePoint on-premise and the results have been quite similar. Using OAuth against SPO is easy and straightforward; we still haven't gotten OAuth to work against SharePoint on-premise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Mar 2020 15:19:48 GMT</pubDate>
    <dc:creator>DirkVandervoort</dc:creator>
    <dc:date>2020-03-17T15:19:48Z</dc:date>
    <item>
      <title>Why does token-based security work for AGOL but not for AGEnt?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258604#M1257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are currently evaluating the pros and cons of ArcGIS Online vs. ArcGIS Enterprise. Part of that evaluation involves determining the differences in implementing our automation toolsets. These are written in Python and consume ArcGIS via the REST API. In both ArcGIS Online and ArcGIS Enterprise we are serving a hosted feature service and an app (with its ClientID and ClientSecret). Both are shared with a group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For all intents and purposes, both the AGOL and the AGEnt implementation patterns are identical.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running with same code returns different results: An access token is obtained using the ClientID/ClientSecret. &lt;SPAN&gt;Using that access token to query the feature service returns the desire&lt;/SPAN&gt;&lt;SPAN&gt;d&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;JSON payload when consuming from AGOL (i.e., features and geometries).&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Using the access token to query the feature service &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;when consuming from AGEnt returns a&amp;nbsp;code 498, Invalid token.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Why is this happening to me? Below is the executed Python&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TIA&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;    query_string &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"client_id"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;appID&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"client_secret"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;appSecret&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"grant_type"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"client_credentials"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;# get an access token &lt;/SPAN&gt;
    response00 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; requests&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;post&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tokenUrl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; params&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;query_string&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    access_token &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; response00&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;json&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"access_token"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

    where &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"1=1"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# MAGIC where clause&lt;/SPAN&gt;
    params &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"where"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; where&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"outFields"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"f"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"json"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'token'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; access_token&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
    response01 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; requests&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;post&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;url &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; featureServiceQueryUrl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; params &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; params&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;# extracting data in json format&lt;/SPAN&gt;
    data01 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; response01&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;json&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    fields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; data01&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'fields'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    features &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; data01&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'features'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:44:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258604#M1257</guid>
      <dc:creator>DirkVandervoort</dc:creator>
      <dc:date>2021-12-11T12:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why does token-based security work for AGOL but not for AGEnt?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258605#M1258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are also experiencing a similar issue on Enterprise. Can't comment on the our similarity to AGOL, but the issue appears in almost all applications that use portal token auth - Web Appbuilder, Operations Dashboard, Python ELT, etc. It is quite frustrating for the implementers and users, and is preventing the adoption of ArcGIS Enterprise&amp;nbsp;in our org. I have also been trying to get support on this issue for over 2 months now and have gone through 3 tiers only to be told that Esri cannot work on Windows IIS issues because it isn't their product. Go figure. Their answer is to spend money on professional services to solve the issue. Would love to hear from any Esri people out there on this issue......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2020 16:14:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258605#M1258</guid>
      <dc:creator>CharlesFritz2</dc:creator>
      <dc:date>2020-03-16T16:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why does token-based security work for AGOL but not for AGEnt?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258606#M1259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI I opened a case with Esri tech support - which is still open. The analyst managed to recreate the issue; now I'm trying to convince them that this is a bug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also FYI we're doing the same exercise with SharePoint Online vs. SharePoint on-premise and the results have been quite similar. Using OAuth against SPO is easy and straightforward; we still haven't gotten OAuth to work against SharePoint on-premise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 15:19:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258606#M1259</guid>
      <dc:creator>DirkVandervoort</dc:creator>
      <dc:date>2020-03-17T15:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why does token-based security work for AGOL but not for AGEnt?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258607#M1260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the update Dirk. Are you using a reverse proxy in a dmz or is it all internal? Have you federated servers to your portal?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2020 18:00:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258607#M1260</guid>
      <dc:creator>CharlesFritz2</dc:creator>
      <dc:date>2020-03-18T18:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why does token-based security work for AGOL but not for AGEnt?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258608#M1261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All internal, we're federated, using internal security (not enterprise or SAML), a pretty vanilla installation really.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2020 18:08:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258608#M1261</guid>
      <dc:creator>DirkVandervoort</dc:creator>
      <dc:date>2020-03-18T18:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why does token-based security work for AGOL but not for AGEnt?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258609#M1262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dirk&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you ever manage to solve this issue? I believe I am running into a similar problem. See my thread here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/message/928813-arcgis-server-invalid-token-from-application-using-rest-api"&gt;https://community.esri.com/message/928813-arcgis-server-invalid-token-from-application-using-rest-api&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2020 01:20:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/why-does-token-based-security-work-for-agol-but/m-p/258609#M1262</guid>
      <dc:creator>JackSilburn</dc:creator>
      <dc:date>2020-05-15T01:20:18Z</dc:date>
    </item>
  </channel>
</rss>

