Embedded credentials for Directions Widget Route URL

2727
4
Jump to solution
12-14-2015 08:24 AM
SBerg_VHB
Occasional Contributor

Does AGOL and the Directions Widget not support embedded credentials for a routing service called from an on premise web server?  If I add the AGOL routing url to MyContent and choose to store the credentials, and then use that URL in the directions widget is works if I access the app from our organization's URL but not from arcgis.com or from our own corporate web server.  In those cases I still get the prompt for credentials.  Use case is a public site using this widget, and application hosted on own web server  Thanks for any thoughts.

Sam

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Sam,

   For your use case example the use of a proxy that stores the credentials is required.

Esri/resource-proxy · GitHub

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Sam,

   For your use case example the use of a proxy that stores the credentials is required.

Esri/resource-proxy · GitHub

SBerg_VHB
Occasional Contributor

Thanks Robert, I'm on it.  It seems as though you have to use "alwaysUseProxy=true" to get it to fire correctly which is not ideal as all requests now go through that server side code, but at least the prompt is avoided.  Appreciate that.

Sam

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Sam,

   The use of alwaysUseProxy=true is definitely not required. You just need to add a rule to your config.json

i.e.

"httpProxy": { 

  "useProxy": true, 

  "alwaysUseProxy": false, 

  "url": "/DotNet/proxy.ashx", 

  "rules": [  

    { "urlPrefix": "http://route.arcgis.com/", "proxyUrl": "/DotNet/proxy.ashx" }, 

    { "urlPrefix": "http://traffic.arcgis.com/", "proxyUrl": "/DotNet/proxy.ashx" } 

  ] 

}

SBerg_VHB
Occasional Contributor

Awesome, thanks.  You know, I had these in the proxy.config but moving them up into the config.json of the app for the proxy did the trick.  Thanks again.

"rules": [

"urlPrefix": "http://route.arcgis.com/",

"proxyUrl": "proxy/proxy.ashx"


"urlPrefix": "http://traffic.arcgis.com/",

"proxyUrl": "proxy/proxy.ashx"


"urlPrefix": "http://utility.arcgis.com/",

"proxyUrl": "proxy/proxy.ashx"


"urlPrefix": "http://logistics.arcgis.com/",

"proxyUrl": "proxy/proxy.ashx"


0 Kudos