AnsweredAssumed Answered

Trying to configure the proxy of a Web AppBuilder application

Question asked by tobe81cwb on Apr 7, 2016
Latest reply on Sep 18, 2016 by misean


Hello,

 

I'm trying to develop with Web AppBuilder for Developers.

Having a hard time with proxy configuration.

 

Used the following tutorial, but with no success:

Setting up a Proxy | Support Services Blog

Setting up a proxy with Web AppBuilder Developer Edition | Support Services Blog

 

My Scenario:

- ArcGIS Server on: https://server.virtual.private:6443/arcgis/manager/

- Portal for ArcGIS on: https://server.virtual.private:7443/arcgis/home/

 

ArcGIS for Server and Portal for ArcGIS was installed with WebAdaptor, checked the following urls, and everything is working:

http://server.virtual.private/arcgis/rest/services

http(s)://server.virtual.private/arcgis/home/ (working on both protocols)

 

Services used on app:

http://server.virtual.private/arcgis/rest/services/SampleWorldCities/MapServer

 

Create a app with default options (default 2d), with map that used the SampleWorldCities service.

Registered the Web App on Portal for ArcGIS and get a App ID and App Secret.

(PS: I not using ArcGIS Online).

 

I'm using Windows 7 with IIS 7 on my local machine to develop...

installed the proxy on IIS from the following address:

GitHub - Esri/resource-proxy: Proxy files for DotNet, Java and PHP.

 

Used the DotNet version, converted to Application, set the pool to use .NET 4.0, and tested entering using the url:

http://mymachineip/DotNet/proxy.ashx and got a

{"error": {"code": 400,"message":"This proxy does not support empty parameters."}}

I think this is a OK response

 

Ok. Following tutorial, registered App on Portal for ArcGIS using the App ID, downloaded the app, put on IIS.

Then, when I try to access, I received a message asking my login and password, because I don't have permission (I don't have configured proxy yet)!

If I enter the username and password of a user of Portal for ArcGIS, everything was working correctly.... so, time to configure the proxy.

 

Looking at tutorial, I modified proxy.config (from DotNet application) with the following information:

<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*" mustMatch="true">
  <serverUrls>
    <serverUrl url="http://services.arcgisonline.com" matchAll="true" />
      
  <serverUrl url="http://server.virtual.private/arcgis/sharing/rest" 
            clientId="wWUNYgmDOth4p4Qx" 
               clientSecret="79818e1d6f2a4a5ba6b94a7d2bf85fb0" 
               matchAll="true" />
   
    <serverUrl url="http://server.virtual.private/arcgis/rest/services" 
            username="siteadmin" 
    password="secret" 
    matchAll="true" />
    
  </serverUrls>
</ProxyConfig>

 

I really don't know what put on the url, clientID and clientSecret (on clientID and clientSecret I have put the same information that was on Portal for ArcGIS - App ID and App Secret - all the documentation I read were not clear to tell me what should I put).

 

In config.json (of web app), I have put the following information:

"httpProxy": {
    "useProxy": true,
    "alwaysUseProxy": false,
    "url": "",
    "rules": [
   {
     "urlPrefix": "http://server.virtual.private/arcgis/sharing/rest",
  "proxyUrl": "http://host-vm/DotNet/proxy.ashx"
   },
   {
     "urlPrefix": "http://server.virtual.private/arcgis/rest/services",
  "proxyUrl": "http://host-vm/DotNet/proxy.ashx"
   }
  ]
  }

 

Tried again access the app (on IIS with proxy), but still asking for username and password.

 

Looking at chome dev tools, there's a warning message with following content:

Error: You do not have permissions to access this resource or perform this operation.(…)

Object {server: "http://server.virtual.private/arcgis", tokenServiceUrl: "https://server.virtual.private/arcgis/sharing/generateToken", hasPortal: true}

 

Any helps?

Outcomes