Hi ,
I am trying to consume a map service url with token using Idenntifymanager. Below is the code I am using.
var tokenValue = "xyz";
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