<?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: CORS error after identifymanager registertoken in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-error-after-identifymanager-registertoken/m-p/1130948#M75798</link>
    <description>&lt;P&gt;My hunch is that IdentityManager requires POST requests via https. Since the app is being run over http to localhost, this is being prevented.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Can you try hosting the app somewhere over https?&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jan 2022 19:14:03 GMT</pubDate>
    <dc:creator>Noah-Sager</dc:creator>
    <dc:date>2022-01-05T19:14:03Z</dc:date>
    <item>
      <title>CORS error after identifymanager registertoken</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-error-after-identifymanager-registertoken/m-p/1130738#M75786</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I am&amp;nbsp; trying to consume a map service url with token using Idenntifymanager. Below is the code I am using.&lt;/P&gt;&lt;P&gt;var tokenValue = "xxxxx";&lt;BR /&gt;IdentityManager.registerToken({&lt;BR /&gt;server: "&lt;A href="https://mydomina.com/arcgis/rest/services" target="_blank"&gt;https://mydomina.com/arcgis/rest/services&lt;/A&gt;",&lt;BR /&gt;token: tokenValue&lt;BR /&gt;});&lt;BR /&gt;var layerUrl = "&lt;A href="https://mydomain/arcgis/rest/services/map/MapServer" target="_blank"&gt;https://mydomain/arcgis/rest/services/map/MapServer&lt;/A&gt;";&lt;BR /&gt;var layer = new ArcGISDynamicMapServiceLayer(layerUrl);&lt;BR /&gt;map.addLayer(layer);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After doing so I can see the layer in the content panel but on the map its not showing. I am getting the below error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ADITYAKUMAR1_0-1641378500753.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/30810iEC2C1BB81DFE0470/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ADITYAKUMAR1_0-1641378500753.png" alt="ADITYAKUMAR1_0-1641378500753.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I remove the identifymanager its working fine.But in order to fetch the data from federated portal I need to pass a token. And while doing so, I am getting the above error. Any one else had the same problem?&lt;/P&gt;&lt;P&gt;I have added&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;esriConfig.defaults.io.corsEnabledServers.push("ourserver.com")&lt;/STRONG&gt;&lt;/SPAN&gt;but this didnt helped&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Aditya Kumar&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 10:31:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-error-after-identifymanager-registertoken/m-p/1130738#M75786</guid>
      <dc:creator>ADITYAKUMAR1</dc:creator>
      <dc:date>2022-01-05T10:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: CORS error after identifymanager registertoken</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-error-after-identifymanager-registertoken/m-p/1130948#M75798</link>
      <description>&lt;P&gt;My hunch is that IdentityManager requires POST requests via https. Since the app is being run over http to localhost, this is being prevented.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Can you try hosting the app somewhere over https?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 19:14:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-error-after-identifymanager-registertoken/m-p/1130948#M75798</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-01-05T19:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: CORS error after identifymanager registertoken</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-error-after-identifymanager-registertoken/m-p/1131224#M75814</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/169842"&gt;@Noah-Sager&lt;/a&gt;&amp;nbsp; Thanks for responding. I tried hosting my solution in the DNS. But problem remains same even after converting http to https.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 15:51:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cors-error-after-identifymanager-registertoken/m-p/1131224#M75814</guid>
      <dc:creator>ADITYAKUMAR1</dc:creator>
      <dc:date>2022-01-06T15:51:10Z</dc:date>
    </item>
  </channel>
</rss>

