Select to view content in your preferred language

Can't See Feature Layers After API Authentication

403
0
06-15-2022 12:21 PM
raydeen
Emerging Contributor

I have a page that accesses feature layers to display on a map. When the feature layers are configured as public, they work fine, but upon setting access to my organization, I receive the following error: 

httpStatus: 403, 

messages: 'You do not have permissions to access this resource or perform this operation.'

 

Here is the relevant code I use. Note that the API key is provided. Is there something else I am missing? Thank you. 

require([
"esri/kernel",
"esri/config",
"esri/identity/IdentityManager",
"esri/Map",
"esri/views/MapView",
"esri/layers/FeatureLayer",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/renderers/SimpleRenderer",
"esri/widgets/LayerList",
"esri/Graphic",
"esri/layers/GraphicsLayer"
], function (
esriKernel,
esriConfig,
IdentityManager,
Map,
MapView,
FeatureLayer,
SimpleMarkerSymbol,
SimpleFillSymbol,
SimpleLineSymbol,
SimpleRenderer,
LayerList,
Graphic,
GraphicsLayer
) {

esriConfig.apiKey = "MY_ORG_API_KEY";

const map = new Map({
basemap: "arcgis-light-gray", // Basemap layer
});

/* Feature, renderer, event, and display code here */
});

0 Kudos
0 Replies