Select to view content in your preferred language

Is it possible to use base maps while authorizing via ArcGIS tokens?

275
0
02-01-2024 03:00 AM
Zamaletto
New Contributor

Hi there!

I'm using IdentityManager to access secured resources (using ArcGIS tokens). There were no issues while I was using portal items like this:

 

const webMap = new WebMap({
    portalItem: {
      id: 'some-portal-id'
    }
  });

 

But recently I tried to add basemaps and the requests were ending up with 401:

 

const webMap = new WebMap({
        basemap: {
          style: {
            language: 'nl',
            id: 'arcgis/dark-gray',
            serviceUrl: `https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles`
          }
        }
      });

 

RenatZamaletdinov_0-1706784978042.png

If I add that token manually to the URL there are no issues

RenatZamaletdinov_1-1706785144606.png

Is there a way to specify a token when creating a basemap instance? Or make it use IdentityManager anyhow?

 

The package I'm using is "@arcgis/core": "^4.28.10"

Tags (2)
0 Replies