CORS error after identifymanager registertoken

01-05-2022 02:31 AM
Occasional Contributor III

Hi ,

 I am  trying to consume a map service url with token using Idenntifymanager. Below is the code I am using.

var tokenValue = "xxxxx";
server: "",
token: tokenValue
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"")but this didnt helped.



Aditya Kumar

0 Kudos
2 Replies
Esri Regular Contributor

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?

0 Kudos
Occasional Contributor III

@Noah-Sager  Thanks for responding. I tried hosting my solution in the DNS. But problem remains same even after converting http to https.

0 Kudos