Hi Michael,
Sure thing. I went ahead and created a Web Appbuilder app called 'ProxyExample'. The web map that the application is using is shared with Everyone, but the hosted service is only shared with the Organization.
In the config.json, I set the httpProperty to the following:
"httpProxy" : {
"useProxy" : true,
"url" : "http://testServer.esri.com/proxyexample/proxy/proxy.ashx",
"alwaysUseProxy" : true,
"rules" : []
}
I copied the .NET proxy to my application directory in a folder called 'proxy'. I then set the proxy.config file to the following:
<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig mustMatch="true" logFile="C:\Temp\Shared\proxy_logs\auth_proxy.log">
<serverUrls>
<serverUrl url="http://services.arcgis.com/Fz6BBJUji5ArUSDM/arcgis/rest/services/"
username="user1"
password="pass1"
matchAll="true">
</serverUrl>
<serverUrl url="http://epro.maps.arcgis.com/" matchAll="true"></serverUrl>
<serverUrl url="http://geocode.arcgis.com/arcgis/rest/" matchAll="true"></serverUrl>
<serverUrl url="http://server.arcgisonline.com/ArcGIS/rest/" matchAll="true"></serverUrl>
<serverUrl url="http://services.arcgisonline.com/ArcGIS/rest/" matchAll="true"></serverUrl>
<serverUrl url="http://serverapi.arcgisonline.com/jsapi/" matchAll="true"></serverUrl>
</serverUrls>
</ProxyConfig>
The first URL is to the ArcGIS Online hosted service, followed by the username and password. The second URL is to my ArcGIS Online Organization. The remaining URLs are to services my application are using (i.e. Geocoding, Basemaps).
I am then able to access the application by going to:
http://testServer.esri.com/proxyexample
When accessing the application, I will not be prompted for a username/password to access the hosted service.