<?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 ArcGIS Server tokens - generateToken not working in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-server-tokens-generatetoken-not-working/m-p/682767#M63576</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have secured services on ArcGIS Server 10.6.1 which I am trying to query using the ArcGIS Rest API. If I use the token service in a web browser and fill in the parameters then I can happily generate a token.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. &lt;A href="https://&amp;lt;domain&amp;gt;/ags/tokens/generateToken"&gt;https://&amp;lt;domain&amp;gt;/ags/tokens/generateToken&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try and use postman (POST request) or a python script using the REST API however, the request is unsuccessful e.g.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/448561_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a web adaptor for web access and the name is not arcgis but ags. I can see from the response that the API seems to be expecting the adaptor to be named arcgis and realise that this issue came up before and there was a bug raised that the web adaptor should use the default name arcgis but the thread suggested that this issue had been fixed from 10.2 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/111516"&gt;https://community.esri.com/thread/111516&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping to avoid renaming the web adaptor on the server as a workaround. Does anyone have any suggestions why using the browser works but requests fail through code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be gratefully received.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 May 2019 10:03:19 GMT</pubDate>
    <dc:creator>DaveAdams</dc:creator>
    <dc:date>2019-05-28T10:03:19Z</dc:date>
    <item>
      <title>ArcGIS Server tokens - generateToken not working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-server-tokens-generatetoken-not-working/m-p/682767#M63576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have secured services on ArcGIS Server 10.6.1 which I am trying to query using the ArcGIS Rest API. If I use the token service in a web browser and fill in the parameters then I can happily generate a token.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. &lt;A href="https://&amp;lt;domain&amp;gt;/ags/tokens/generateToken"&gt;https://&amp;lt;domain&amp;gt;/ags/tokens/generateToken&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try and use postman (POST request) or a python script using the REST API however, the request is unsuccessful e.g.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/448561_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a web adaptor for web access and the name is not arcgis but ags. I can see from the response that the API seems to be expecting the adaptor to be named arcgis and realise that this issue came up before and there was a bug raised that the web adaptor should use the default name arcgis but the thread suggested that this issue had been fixed from 10.2 :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/111516"&gt;https://community.esri.com/thread/111516&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping to avoid renaming the web adaptor on the server as a workaround. Does anyone have any suggestions why using the browser works but requests fail through code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be gratefully received.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2019 10:03:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-server-tokens-generatetoken-not-working/m-p/682767#M63576</guid>
      <dc:creator>DaveAdams</dc:creator>
      <dc:date>2019-05-28T10:03:19Z</dc:date>
    </item>
  </channel>
</rss>

