<?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: HTTP header authentication vs `token` parameter in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/http-header-authentication-vs-token-parameter/m-p/1316702#M4535</link>
    <description>&lt;P&gt;Hello &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/350691"&gt;@John-Foster&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;Thanks for writing.&lt;/P&gt;&lt;P&gt;I do have those privileges assigned:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="egorbn_0-1691540762436.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/77625iAFA07B976C640631/image-size/medium?v=v2&amp;amp;px=400" role="button" title="egorbn_0-1691540762436.png" alt="egorbn_0-1691540762436.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And using the same token as a `token` parameter in the request, rather than in the header, works.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Aug 2023 00:26:56 GMT</pubDate>
    <dc:creator>egorbn</dc:creator>
    <dc:date>2023-08-09T00:26:56Z</dc:date>
    <item>
      <title>HTTP header authentication vs `token` parameter</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/http-header-authentication-vs-token-parameter/m-p/1312385#M4521</link>
      <description>&lt;P&gt;Hi folks, I'm using the ArcGIS REST API directly from a python script through the `requests` library.&lt;/P&gt;&lt;P&gt;I've developed the script to use the /generateToken call, and then include the token in the `token` parameter.&lt;/P&gt;&lt;P&gt;Using this approach, I'm able to submit CopyRaster jobs, which run sucessfully.&lt;/P&gt;&lt;P&gt;Recently, I tried to implement the suggested approach to tokens as described in &lt;A href="https://developers.arcgis.com/documentation/mapping-apis-and-services/security/http-header-authentication/#non-web-tiered-authentication" target="_blank" rel="noopener"&gt;HTTP header authentication&lt;/A&gt; documentation, where the token is part of the `X-Esri-Authorization` header.&lt;/P&gt;&lt;P&gt;The issue is that in this case, the CopyRaster jobs fails with the following message:&lt;/P&gt;&lt;P&gt;Messages: [{'type': 'esriJobMessageTypeInformative', 'description': 'Submitted.'}, {'type': 'esriJobMessageTypeInformative', 'description': 'Executing...'}, {'type': 'esriJobMessageTypeInformative', 'description': 'Start Time: Wednesday, July 26, 2023 11:11:26 PM'}, &lt;STRONG&gt;{'type': 'esriJobMessageTypeError', 'description': '{"messageCode": "RA_120305", "message": "Your need either hosted tiled imagery or hosted dynamic imagery privilege to create hosted imagery layer."}'}, {'type': 'esriJobMessageTypeError', 'description': '{"messageCode": "RA_120002", "message": "CopyRaster failed. Unexpected Error occured during service Execution. ."}'}&lt;/STRONG&gt;, {'type': 'esriJobMessageTypeError', 'description': '{"messageCode": "RA_120306", "message": "Cause of failure: Unexpected Error occured during service Execution. .", "params": {"cause": "Cause of failure: Unexpected Error occured during service Execution. "}}'}, {'type': 'esriJobMessageTypeInformative', 'description': 'Failed script CopyRaster...'}, {'type': 'esriJobMessageTypeError', 'description': 'Failed to execute (CopyRaster).'}, {'type': 'esriJobMessageTypeInformative', 'description': 'Failed at Wednesday, July 26, 2023 11:11:37 PM (Elapsed Time: 10.11 seconds)'}, {'type': 'esriJobMessageTypeError', 'description': 'Failed.'}]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only difference is the token being in the header or in the `token` parameter. Everything else is the same. Mind you, the job is submitted successfully.&lt;/P&gt;&lt;P&gt;What is the issue? It's the same token...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PS. There's a typo in the error message: &lt;STRONG&gt;Your need either hosted tiled imagery or hosted dynamic imagery privilege to create hosted imagery layer.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 23:44:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/http-header-authentication-vs-token-parameter/m-p/1312385#M4521</guid>
      <dc:creator>egorbn</dc:creator>
      <dc:date>2023-07-26T23:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP header authentication vs `token` parameter</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/http-header-authentication-vs-token-parameter/m-p/1315753#M4534</link>
      <description>&lt;P&gt;The error message seems to be telling you the authentication token you are providing does not have the correct privileges required for the CopyRaster jobs.&lt;/P&gt;&lt;P&gt;Is there any way you can determine if your account as the portal:publisher:publishTiledImagery and portal:publisher:publishDynamicImagery privileges assigned to it?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 22:38:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/http-header-authentication-vs-token-parameter/m-p/1315753#M4534</guid>
      <dc:creator>John-Foster</dc:creator>
      <dc:date>2023-08-04T22:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: HTTP header authentication vs `token` parameter</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/http-header-authentication-vs-token-parameter/m-p/1316702#M4535</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/350691"&gt;@John-Foster&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;Thanks for writing.&lt;/P&gt;&lt;P&gt;I do have those privileges assigned:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="egorbn_0-1691540762436.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/77625iAFA07B976C640631/image-size/medium?v=v2&amp;amp;px=400" role="button" title="egorbn_0-1691540762436.png" alt="egorbn_0-1691540762436.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And using the same token as a `token` parameter in the request, rather than in the header, works.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 00:26:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/http-header-authentication-vs-token-parameter/m-p/1316702#M4535</guid>
      <dc:creator>egorbn</dc:creator>
      <dc:date>2023-08-09T00:26:56Z</dc:date>
    </item>
  </channel>
</rss>

