Using the web app builder I have created an application in which I would like to include the A to B driving directions widget for all users of the map. Unfortunately, when I test the app without being logged in to my organizational account, the driving directions tool redirects to a login page. After many hours of mucking about I cannot figure out how or where to configure the application so that my end users can create driving directions without needing an online account.
Here's the app:
You will have to setup a proxy on your web server to do the user validation to your org for you as the routing takes credits.
See this whole blog post but specifically step 11.
Hi Robert - thanks for info. Is this the only way?
The note at the top of the post just before step one says that the proxy page must be located on the same server as my javascipt application. But I'm not running the app locally. It runs off ESRI's servers using layers I've published through our State's Enterprise GIS.
Thanks Again - I'll keep plugging away it this!
I found some guidance here:
"When you want to share Esri premium content in apps that support anonymous access, for example, a public site locator app that includes the Esri World Route Service, you can follow a similar workflow to sharing your own secure services. Add the Esri service item as a new item to your My Content and follow the rest of the steps above. Be sure to share the item with everyone (public)."
I've followed these steps and still get prompted for credentials when not logged in.
Have you added both: Network analysis service and geocoder service and stored them with credentials? It seems like the directions widget uses these two services.
Can you see this application and perform A to B directions without being redirected to the login page?
Thank You Aravind! That did the trick. Now I need to make sure I have the Limit Usage set up correctly or I'm gonna get hammered.@
For what it's worth I was not able to access your driving directions test without being prompted for my credentials.
Hi Aravind, I have a similar problem, hope you can help.
I built an app and I would like to use the directions widget. I've added both Network Analysis Service and Geocode Service and stored them with credentials.
In the Web Appbuilder I edited the directions widget and updated both links (for the route and geocode) to reference the REST Connections that are given in the item details page.
However, my directions widget is still not working, it's just loading. Hope you can help.
If there is a web server available to you, I would download your web app from AGOL and host it locally. This would then allow you to proxy with credentials for using credits for Networking and routing.