If you spend enough time in ArcGIS Online building web applications for your organization, you'll likely have the need to include Esri Premium Services like Live Traffic, especially if your organization is a State Department of Transportation. While Live Traffic does not cost credits, it does require a named user to log in, and access the premium content. You of course know this because when you launched the application you tirelessly spent all that time configuring you hit the snag where the app requires the user to sign in. So how are you supposed to deploy a public app with traffic cameras, weather and live traffic if your app requires a login?
You could provide an access token that you embed in your application but that requires you customize or develop an application which means you have to host it. In addition, this creates a security risk, because your token could be hijacked and used without you ever knowing.
An easier solution is to create a proxy service configuration for the premium service of your choice. A proxy service allows you to encode and manage your credentials inside a service URL. In addition proxy services support rate limiting. This allows you to make the Esri World Geocoding Service available to an end user for batch Geocoding or other operations which do consume credits. However it protects you because you can specify the rate at which addresses can be batch geocoded preventing runaway usage while allowing the public the access they need.
Here is how it works.
- Log into developers.arcgis.com with your ArcGIS Online credentials
- Register your application by choosing Register New Application
- Provide the Application Details
- Click on the Authentication Tab
- Scroll down to the Service Proxies area.
- Select the service you wish to proxy and enter a rate limit for the number of requests you want to allow over a given period.
- Copy the newly created proxy URL and add it to the webmap that your application is consuming. Remove the original service if it exists and save the webmap.
- Log out of all web sessions using you ArcGIS Online credentials or use Incognito Mode on your browser to test that your app opens without challenging you for credentials. (This is a quick trick to allow you to open the browser with a cleared browser cache.) ! !
- Open your web application and bask in the glory of your app opening withPremium Services that don't prompt your public users for an ArcGIS Online Username and Password.
Besides Traffic and Batch Geocoding you can also proxy the following services: