AnsweredAssumed Answered

Serve a JS map app through a proxy that publishes a locally-hosted web map that contain secure content. How to?

Question asked by vandervoort on Mar 16, 2016
Latest reply on Mar 17, 2016 by rscheitlin

We have the full stack of ArcGIS Server and Portal hosted on-premise. We've authored a map service that is secured. In Portal we created a web map that uses an ArcGIS Online basemap and the secured map service. We then wrote a simple JS application that serves the web map. It requires the user to enter credentials - we do not want users to enter credentials, yet the map service must remain secure.

 

Enter the proxy, download from Releases · Esri/resource-proxy · GitHub

 

Following the instructions here: Sharing maps with secure layers | Guide | ArcGIS API for JavaScript,

...adding the appropriate urlUtils and proxy.configs

Results in a 403 error.

 

The JS is here:

urlUtils.addProxyRule({
   urlPrefix: "https://subdomain.domain.com",
   proxyUrl: "proxy/proxy.ashx"
});


arcgisUtils.arcgisUrl = "https://subdomain.domain.com/portal/sharing/content/items";
arcgisUtils.createMap("<WEB_MAP_ID>","map").then(function(response){});

 

The content of the proxy.config has:

<serverUrl clientId="<ClientID>" clientSecret="<Client_Secret" rateLimit="0" 
rateLimitPeriod="1" matchAll="true" url="https://subdomain.domain.com/arcgis/rest/services/MapService/MapServer"/>

 

As per the sample. Yet I still get the 403

GET https://subdomain.domain.com/proxytest/proxy/proxy.ashx?https://subdomain.domain…d189aa97?f=json&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback 403 (Forbidden)

 

Can anyone with experience in this realm help provide insight for me please. TIA

Outcomes