<?xml version="1.0" encoding="utf-8" ?>
<!-- Proxy config is used to set the ArcGIS Server services that the proxy will forward to.
mustMatch: true to only proxy to sites listed, false to proxy to any site -->
<ProxyConfig mustMatch="true">
<serverUrls>
<!-- serverUrl options:
url = location of the ArcGIS Server, either specific URL or stem
matchAll = true to forward any request beginning with the url
token = (optional) token to include for secured service
dynamicToken = if true, gets token dynamically with username and
password stored in web.config file's appSettings section.
-->
<serverUrl url="https://www.arcgis.com/sharing/generateToken?parameters"
matchAll="true"
userName="our city username is entered here"
password="our city password is entered here"
referer="http://localhost/fwbjava/default.html"></serverUrl>
expiration="1440"
f="json"
</serverUrls>
</ProxyConfig>
<?xml version="1.0" encoding="utf-8" ?>
<!-- Proxy config is used to set the ArcGIS Server services that the proxy will forward to.
mustMatch: true to only proxy to sites listed, false to proxy to any site -->
<ProxyConfig mustMatch="true">
<serverUrls>
<!-- serverUrl options:
url = location of the ArcGIS Server, either specific URL or stem
matchAll = true to forward any request beginning with the url
token = (optional) token to include for secured service
dynamicToken = if true, gets token dynamically with username and
password stored in web.config file's appSettings section.
-->
<serverUrl url="https://www.arcgis.com/sharing/generateToken?parameters"
matchAll="true"
dynamicToken = "true"
referer="http://localhost/fwbjava/default.html"></serverUrl>
expiration="1440"
f="json"
</serverUrls>
</ProxyConfig>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
userName="city username"
password="city password"
</configuration>
callback=dojo.io.script.jsonp_dojoIoScript107._jsonpCallback
directionsLanguage=en
directionsLengthUnits=esriNAUMiles
directionsOutputType=esriDOTComplete
findBestSequence=false
http://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World/solve?f=json
outSR=102100
returnBarriers=false
returnDirections=true
returnPolygonBarriers=false
returnPolylineBarriers=false
returnRoutes=false
returnStops=false
stops={"type":"features","features":[{"geometry":{"x":-9642517.808238365,"y":3557110.1926639024,"spatialReference":{"wkid":102100}},"attributes":{"address":"51 Silva Dr NW, Fort Walton Beach, FL, 32548"}},{"geometry":{"x":-9642459.852759078,"y":3555678.421692784,"spatialReference":{"wkid":102100}},"attributes":{"address":"105 Miracle Strip Pky Sw, Fort Walton Beach, FL, 32548"}}],"doNotLocateOnRestrictedElements":true}
esri.addProxyRule({
urlPrefix : "route.arcgis.com",
proxyUrl : "/proxy"
});
<serverUrl url="http://route.arcgis.com/arcgis/rest/services/" matchAll="true"> </serverUrl> <serverUrl url="http://www.arcgis.com/sharing/" matchAll="true"> </serverUrl>
<serverUrl url="http://route.arcgis.com/arcgis/rest/services/" matchAll="true" token="myreallylongtoken"> </serverUrl>
i still haven't figured out how to get my proxy to generate a token dynamically, but i was able to hard-code a long term token generated using a referrer and confirm that it allowed me to route without authenticating in my app.
<!-- serverUrl options: url = location of the ArcGIS Server, either specific URL or stem matchAll = true to forward any request beginning with the url token = (optional) token to include for secured service dynamicToken = if true, gets token dynamically with username and password stored in this file. userName = the secured user's username password = the password for the username host = the machine name that is hosting the map service --> <serverUrl url="http://route.arcgis.com/arcgis/rest/services" matchAll="true" dynamicToken="true" host="host_name" userName="userName" password="password"> </serverUrl>