esri.config.defaults.io.proxyUrl is not set.

3756
1
04-12-2013 10:12 AM
JasonCleaver
Occasional Contributor
I am getting this error when I try to connect to a secured service. Here is the scenario.

ArcGIS for Server is behind our corporate firewall.  Access to this server from outside the firewall is over https.  IP traffic from the firewall/proxy to the server is http. 

From my local developer machine, I added a dynamic layer -- http://internalservername/arcgis/rest/services/test/mapserver.  When I view the site using FireFox, the IdentityManager appears as expected.

Now I added a second dynamic layer -- https://externalservername.com/arcgis/rest/services/test/mapserver, pointing to the same exact service, on the same server. 

When I refresh the browser, I am challenged twice, as expected.  Note:  I used the esri.ServerInfo() class because the URL for accessing the tokens from outside the firewall was http://externalservername.com/arcgis/tokens and it should really be https://externalservername.com/arcgis/tokens...

So, all is working until I remove the first layer, http://internalservername/arcgis/rest/services/test/mapserver

When I load the page, I am seeing two errors:

dojo.io.script.error Error: Token Requird
esri.config.defaults.io.proxyurl is not set

Jason
0 Kudos
1 Reply
KellyHutchins
Esri Frequent Contributor
Sounds like you  need to setup a proxy. Instructions on how to do so can be found here:

http://help.arcgis.com/en/webapi/javascript/arcgis/jshelp/ags_proxy.html

Once the proxy is working set the

esri.config.defaults.io.proxyurl to the url of the proxy.
0 Kudos