<?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 webmap from json with token in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webmap-from-json-with-token/m-p/415014#M38198</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to embed a webmap with a demographics layer in an application.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ive followed much of the advice provided in this thread here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/100095-Programmatically-Log-In-to-ArcGIS-Online-via-Javascript-Application?highlight=createMap" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/100095-Programmatically-Log-In-to-ArcGIS-Online-via-Javascript-Application?highlight=createMap&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am able to render the map/layer without a login, but I am getting some httpCode '498' | 'Invalid Token' | 'Unable to draw graphic (geometry: null, symbol: null) : Invalid Token' errors. There 6 of these for my webmap which includes 2 basemap layers and 1 operational (household income) operational layer. Also the popups for the demographics layer do not work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's what I'm doing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.&amp;nbsp; Call a server-side class to get a token.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.&amp;nbsp; Set esri.id = null to suppress the login. (this works)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3.&amp;nbsp; Create the webmap from json.&amp;nbsp; I am including the token in the layer object for my operational layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; webmap.itemData = {
&amp;nbsp;&amp;nbsp;&amp;nbsp; "operationalLayers": [{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "url": "http://demographics1.arcgis.com/arcgis/rest/services/USA_Demographics_and_Boundaries/MapServer" + '?token=' + this.accessToken,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "visibility": true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "opacity": 0.75,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "title": "USA Average Household Income",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "itemId": "3812e0b5526d4f8798840c86f9fd9ce7"
&amp;nbsp;&amp;nbsp;&amp;nbsp; }]&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also tried iterating over the response to set the layerObject._url.query.token (per the above thread).&amp;nbsp; This isnt effective and seems unnecessary since my token value is is already sitting in that object key.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I missing here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Greg&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:48:38 GMT</pubDate>
    <dc:creator>GregKnight</dc:creator>
    <dc:date>2021-12-11T18:48:38Z</dc:date>
    <item>
      <title>webmap from json with token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webmap-from-json-with-token/m-p/415014#M38198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to embed a webmap with a demographics layer in an application.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ive followed much of the advice provided in this thread here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/100095-Programmatically-Log-In-to-ArcGIS-Online-via-Javascript-Application?highlight=createMap" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/100095-Programmatically-Log-In-to-ArcGIS-Online-via-Javascript-Application?highlight=createMap&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am able to render the map/layer without a login, but I am getting some httpCode '498' | 'Invalid Token' | 'Unable to draw graphic (geometry: null, symbol: null) : Invalid Token' errors. There 6 of these for my webmap which includes 2 basemap layers and 1 operational (household income) operational layer. Also the popups for the demographics layer do not work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's what I'm doing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.&amp;nbsp; Call a server-side class to get a token.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.&amp;nbsp; Set esri.id = null to suppress the login. (this works)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3.&amp;nbsp; Create the webmap from json.&amp;nbsp; I am including the token in the layer object for my operational layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; webmap.itemData = {
&amp;nbsp;&amp;nbsp;&amp;nbsp; "operationalLayers": [{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "url": "http://demographics1.arcgis.com/arcgis/rest/services/USA_Demographics_and_Boundaries/MapServer" + '?token=' + this.accessToken,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "visibility": true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "opacity": 0.75,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "title": "USA Average Household Income",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "itemId": "3812e0b5526d4f8798840c86f9fd9ce7"
&amp;nbsp;&amp;nbsp;&amp;nbsp; }]&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also tried iterating over the response to set the layerObject._url.query.token (per the above thread).&amp;nbsp; This isnt effective and seems unnecessary since my token value is is already sitting in that object key.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I missing here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Greg&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:48:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webmap-from-json-with-token/m-p/415014#M38198</guid>
      <dc:creator>GregKnight</dc:creator>
      <dc:date>2021-12-11T18:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: webmap from json with token</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webmap-from-json-with-token/m-p/415015#M38199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well it seems that one can avoid all this mess with a properly configured proxy. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Livin' and Learnin'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greg&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Mar 2014 16:37:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webmap-from-json-with-token/m-p/415015#M38199</guid>
      <dc:creator>GregKnight</dc:creator>
      <dc:date>2014-03-03T16:37:19Z</dc:date>
    </item>
  </channel>
</rss>

