Hi ,
I am trying to consume a map service url with token using Idenntifymanager. Below is the code I am using.
var tokenValue = "xxxxx";
IdentityManager.registerToken({
server: "https://mydomina.com/arcgis/rest/services",
token: tokenValue
});
var layerUrl = "https://mydomain/arcgis/rest/services/map/MapServer";
var layer = new ArcGISDynamicMapServiceLayer(layerUrl);
map.addLayer(layer);
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.
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?
I have added esriConfig.defaults.io.corsEnabledServers.push("ourserver.com")but this didnt helped.
Thanks
Aditya Kumar
My hunch is that IdentityManager requires POST requests via https. Since the app is being run over http to localhost, this is being prevented.
https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html
Can you try hosting the app somewhere over https?
@Noah-Sager Thanks for responding. I tried hosting my solution in the DNS. But problem remains same even after converting http to https.