<?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 How to apply token when using client_credentials / apiKey to access an ArcGis Enterprise Map in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-apply-token-when-using-client-credentials/m-p/1654378#M43171</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to access a map on our new ArcGis Enterprise instance. Our admin has created a client_id and client_secret and I've used those to successfully retrieve a token using the following url:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;string arcGisTokenUrl = $"{_arcGisOptions.ServerUrl}/portal/sharing/rest/oauth2/token";&lt;/LI-CODE&gt;&lt;P&gt;I'm then using that token in our React application like this:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;      const portalUrl = 'https://our.arcgis.enterprise.domain.com/portal';
      const serverUrl = 'https://our.arcgis.enterprise.domain.com/server';

      esriConfig.portalUrl = portalUrl

      esriConfig.apiKeys.scopes = [{
        token: tokenToUse?.token || '',
        urls: [portalUrl, serverUrl]
      }]     &lt;/LI-CODE&gt;&lt;P&gt;My issue is the map I'm loading has an arcgis online base layer. It apperas that setting the portalUrl ito my server is causing the base layer map features to fail with an "Invalid Token" error.&amp;nbsp; I'm not sure how to fix this, as I have to set the portalUrl, but I can't set it if I want to use public basemaps?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What can I do?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Sep 2025 22:38:21 GMT</pubDate>
    <dc:creator>RockyCherry</dc:creator>
    <dc:date>2025-09-30T22:38:21Z</dc:date>
    <item>
      <title>How to apply token when using client_credentials / apiKey to access an ArcGis Enterprise Map</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-apply-token-when-using-client-credentials/m-p/1654378#M43171</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to access a map on our new ArcGis Enterprise instance. Our admin has created a client_id and client_secret and I've used those to successfully retrieve a token using the following url:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;string arcGisTokenUrl = $"{_arcGisOptions.ServerUrl}/portal/sharing/rest/oauth2/token";&lt;/LI-CODE&gt;&lt;P&gt;I'm then using that token in our React application like this:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;      const portalUrl = 'https://our.arcgis.enterprise.domain.com/portal';
      const serverUrl = 'https://our.arcgis.enterprise.domain.com/server';

      esriConfig.portalUrl = portalUrl

      esriConfig.apiKeys.scopes = [{
        token: tokenToUse?.token || '',
        urls: [portalUrl, serverUrl]
      }]     &lt;/LI-CODE&gt;&lt;P&gt;My issue is the map I'm loading has an arcgis online base layer. It apperas that setting the portalUrl ito my server is causing the base layer map features to fail with an "Invalid Token" error.&amp;nbsp; I'm not sure how to fix this, as I have to set the portalUrl, but I can't set it if I want to use public basemaps?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What can I do?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Sep 2025 22:38:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/how-to-apply-token-when-using-client-credentials/m-p/1654378#M43171</guid>
      <dc:creator>RockyCherry</dc:creator>
      <dc:date>2025-09-30T22:38:21Z</dc:date>
    </item>
  </channel>
</rss>

