<?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 Is it possible to use base maps while authorizing via ArcGIS tokens? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-use-base-maps-while-authorizing/m-p/1376966#M83511</link>
    <description>&lt;P&gt;Hi there!&lt;/P&gt;&lt;P data-unlink="true"&gt;I'm using &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html" target="_self"&gt;IdentityManager&lt;/A&gt;&amp;nbsp;to access secured resources (using ArcGIS tokens). There were no issues while I was using portal items like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const webMap = new WebMap({
    portalItem: {
      id: 'some-portal-id'
    }
  });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But recently I tried to add basemaps and the requests were ending up with 401:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const webMap = new WebMap({
        basemap: {
          style: {
            language: 'nl',
            id: 'arcgis/dark-gray',
            serviceUrl: `https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles`
          }
        }
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RenatZamaletdinov_0-1706784978042.png" style="width: 705px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/93422i9E7A4288DADFC5B3/image-dimensions/705x222?v=v2" width="705" height="222" role="button" title="RenatZamaletdinov_0-1706784978042.png" alt="RenatZamaletdinov_0-1706784978042.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I add that token manually to the URL there are no issues&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RenatZamaletdinov_1-1706785144606.png" style="width: 762px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/93423i2A4689084BABE93B/image-dimensions/762x297?v=v2" width="762" height="297" role="button" title="RenatZamaletdinov_1-1706785144606.png" alt="RenatZamaletdinov_1-1706785144606.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there a way to specify a token when creating a basemap instance? Or make it use IdentityManager anyhow?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The package I'm using is&amp;nbsp;&lt;STRONG&gt;"@arcgis/core": "^4.28.10"&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2024 11:04:38 GMT</pubDate>
    <dc:creator>Zamaletto</dc:creator>
    <dc:date>2024-02-01T11:04:38Z</dc:date>
    <item>
      <title>Is it possible to use base maps while authorizing via ArcGIS tokens?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-use-base-maps-while-authorizing/m-p/1376966#M83511</link>
      <description>&lt;P&gt;Hi there!&lt;/P&gt;&lt;P data-unlink="true"&gt;I'm using &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html" target="_self"&gt;IdentityManager&lt;/A&gt;&amp;nbsp;to access secured resources (using ArcGIS tokens). There were no issues while I was using portal items like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const webMap = new WebMap({
    portalItem: {
      id: 'some-portal-id'
    }
  });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But recently I tried to add basemaps and the requests were ending up with 401:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const webMap = new WebMap({
        basemap: {
          style: {
            language: 'nl',
            id: 'arcgis/dark-gray',
            serviceUrl: `https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles`
          }
        }
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RenatZamaletdinov_0-1706784978042.png" style="width: 705px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/93422i9E7A4288DADFC5B3/image-dimensions/705x222?v=v2" width="705" height="222" role="button" title="RenatZamaletdinov_0-1706784978042.png" alt="RenatZamaletdinov_0-1706784978042.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I add that token manually to the URL there are no issues&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RenatZamaletdinov_1-1706785144606.png" style="width: 762px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/93423i2A4689084BABE93B/image-dimensions/762x297?v=v2" width="762" height="297" role="button" title="RenatZamaletdinov_1-1706785144606.png" alt="RenatZamaletdinov_1-1706785144606.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there a way to specify a token when creating a basemap instance? Or make it use IdentityManager anyhow?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The package I'm using is&amp;nbsp;&lt;STRONG&gt;"@arcgis/core": "^4.28.10"&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 11:04:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-use-base-maps-while-authorizing/m-p/1376966#M83511</guid>
      <dc:creator>Zamaletto</dc:creator>
      <dc:date>2024-02-01T11:04:38Z</dc:date>
    </item>
  </channel>
</rss>

