How do I add a layer to a map from a widget when the layer is secured and requires authentication? Currently, the secured layer gets added to the map, but an authentication popup appears. I'm hoping I can add a token or credentials to the layer properties and so circumvent the authentication popup. The layer that I'm trying to add is secured and visible externally in our DMZ. We'd like our users to not see the authentication popup, if possible. I've been experimenting with IdentityManager using the online examples, but these samples don't seem to apply well to Web App Builder apps and widgets.
Solved! Go to Solution.
Andrew,
Sorry I am drawing a blank than.
I have this working now. For those who are new to using the proxy, here are some important considerations.
"httpProxy": {
"useProxy": true,
"alwaysUseProxy": false,
"url": "",
"rules":[{
"urlPrefix": "http://<domain>/arcgis/rest/services/.../MapServer",
"proxyUrl": "http://localhost/proxy/proxy.ashx"
}
]
},
<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*"
mustMatch="true"
logFile="proxylog.txt">
<serverUrls>
<serverUrl url="http://<serviceUrl>"
matchAll="true"
username="<username>"
password="<password>"
oauth2Endpoint="https://www.arcgis.com/sharing/oauth2/"/>
</serverUrls>
</ProxyConfig>