I am trying to consume a map service url with token using Idenntifymanager. Below is the code I am using.
var tokenValue = "xxxxx";
var layerUrl = "https://mydomain/arcgis/rest/services/map/MapServer";
var layer = new ArcGISDynamicMapServiceLayer(layerUrl);
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.
My hunch is that IdentityManager requires POST requests via https. Since the app is being run over http to localhost, this is being prevented.
Can you try hosting the app somewhere over https?