How To: Embed credentials into a routing service for public usage in the Directions widget


Some organizations require field personnel to access a routing service via the Directions widget while in the field. As these are not named users, they are unable to provide login credentials, which the routing service requires. For more information on named users, refer to ArcGIS Help: Named user.


The following workflow helps embed credentials in a routing service for use with the Directions widget, which allows non-named users to access the service without being prompted for login credentials. This workflow includes adding the URL for the organization and the application to the Limit Usage section of the routing service.

  1. Log in to ArcGIS Online, and navigate to My Content > Add Item > From Web.
  2. In the Item from the Web dialog box, ensure the following sections are defined:
    1. Type : <select ArcGIS Server web service>
    2. URL : <insert the routing service URL> NOTE: When prompted, insert username and password.
    3. Title : <insert Title here>
    4. Tags : <insert Tags here>
Image of the fields to populate
  1. Click Add Item. ArcGIS Online redirects the page to the Item Details page for the new Network Analysis service.
  2. Share the service publicly.
  3. On the Overview tab, click Copy below the URL heading.
This URL is required for the Directions widget. 
  1. Open the application containing the Directions widget, navigate to the Widget tab, and select and remove the current Directions widget.
  2. When prompted, click OK.
  3. Create a new Directions widget in the application. In the Configure Directions dialog, ensure the following sections are defined:
    1. Route URL : <insert the URL copied in Step 5>
    2. The remaining sections can be defined as required.
Image of the route URL to populate
Click OK and save the changes made to the application.
  1. Copy the URL for the application.
  2. Navigate to My Content > Item Details of the Network Analysis service > Settings > Limit Usage.
  3. Paste the application URL copied in Step 7 in the Referrer URL or IP section, and click Add.
  4. Add the home URL. An example is as follows:
<organization short URL>.maps.arcgis.com
  1. Click Add > OK. This allows the application to utilize the routing service with the preset credentials.
If the service is made public, all users accessing the routing service can access the features and functions of the application. This includes features and functions that cost credits.

Related Information