.NET proxy setup no longer working for WAB Dev 2.4

3500
20
Jump to solution
03-27-2017 03:06 PM
BarnabyRockwell
Regular Contributor

I have been using the proxy setup described by Robert Scheitlin here:

Internal ONLY Web Map Sharing Issues 

to get around AGOL logins for an internal-only, locally-hosted WAB Dev app that calls an AGOL Web Map.  I used username and password authentication.  The referenced Web Map is shared with my organization, and is not publicly available.

When I updated the app to WAB Dev 2.4, the proxy setup no longer works, and all I get is a blank (white) browser screen.

App config.json:

  "httpProxy":{

    "useProxy":true,

    "alwaysUseProxy":false,

    "url":"/DotNet/proxy.ashx",

    "rules":[{  
        "urlPrefix": "http://myorg.maps.arcgis.com/",  
        "proxyUrl": "/DotNet/proxy.ashx"  
    }]

},

proxy.config:

<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*"
             mustMatch="true">
    <serverUrls>
        <serverUrl url="http://myorg.maps.arcgis.com"
                   username="username"  
                   password="password"  
                   matchAll="true"/>  
        <serverUrl url="http://services.arcgisonline.com"  
                   matchAll="true"/>
        <serverUrl url="http://myinternalserver"  
                   matchAll="true"/>
    </serverUrls>
</ProxyConfig>

<!-- See https://github.com/Esri/resource-proxy for more information -->

Does anyone know how I can get the proxy working again?  The proxy is still working for my WD 2.3 apps on the same server.  I'm running ArcGIS Server 10.5.

0 Kudos
1 Solution

Accepted Solutions
CCWeedcontrol
Regular Contributor

I figured out what what wrong with mine. No sure if its the same problem you have but after looking at my Chrome network in developer tools  i noticed that my proxy was getting stuck at' proxy.ashx?https://****.maps.arcgis.com/sharing/rest.. '

in my proxy config i had http://***.maps.arcgis.com, my proxy config file did not have 'https'. once i changed http to https in the proxy config it worked. Not sure why it's https. When i set up WEB 2.4 I put both http and https. My developer page shows my url as http not https.

I checked my 2.3 apps in Chrome network developer tools and the proxy is proxy.ashx?http://****.maps.arcgis.com/sharing/rest and that's why i had on my proxy config.

Not sure why it changed...?

anyway after 5 hrs of trouble shooting, hopes this helps.

View solution in original post

20 Replies
BarnabyRockwell
Regular Contributor

In Firefox, I get this error after loading the app with the proxy:

jimu.js init...  main.js:187:7
Load Config: timer startedConfigLoader.js:85
dojo.io.script error Error:
Stack trace:
x/g.error@http://js.arcgis.com/3.20/init.js:984:275
.cache["dojo/_base/xhr"]/</a._ioSetArgs/<@http://js.arcgis.com/3.20/init.js:87:530
c@http://js.arcgis.com/3.20/init.js:103:393
d@http://js.arcgis.com/3.20/init.js:103:182
.cache["dojo/_base/Deferred"]/</a.Deferred/this.errback@http://js.arcgis.com/3.20/init.js:105:163
c@http://js.arcgis.com/3.20/init.js:104:142
d@http://js.arcgis.com/3.20/init.js:103:182
.cache["dojo/_base/Deferred"]/</a.Deferred/this.errback@http://js.arcgis.com/3.20/init.js:105:163
c@http://js.arcgis.com/3.20/init.js:104:142
d@http://js.arcgis.com/3.20/init.js:103:182
.cache["dojo/_base/Deferred"]/</a.Deferred/this.errback@http://js.arcgis.com/3.20/init.js:105:163
.cache["dojo/io/script"]/</b.get/<@http://js.arcgis.com/3.20/init.js:999:98
.cache["dojo/Deferred"]/</n@http://js.arcgis.com/3.20/init.js:107:277
.cache["dojo/Deferred"]/</r@http://js.arcgis.com/3.20/init.js:107:203
.cache["dojo/Deferred"]/</d/this.reject@http://js.arcgis.com/3.20/init.js:109:488
.cache["dojo/Deferred"]/</b@http://js.arcgis.com/3.20/init.js:108:172
.cache["dojo/Deferred"]/</n@http://js.arcgis.com/3.20/init.js:107:450
.cache["dojo/Deferred"]/</r@http://js.arcgis.com/3.20/init.js:107:203
.cache["dojo/Deferred"]/</d/this.reject@http://js.arcgis.com/3.20/init.js:109:488
.cache["dojo/Deferred"]/</b@http://js.arcgis.com/3.20/init.js:108:172
.cache["dojo/Deferred"]/</n@http://js.arcgis.com/3.20/init.js:107:450
.cache["dojo/Deferred"]/</r@http://js.arcgis.com/3.20/init.js:107:203
.cache["dojo/Deferred"]/</d/this.reject@http://js.arcgis.com/3.20/init.js:109:488
.cache["dojo/Deferred"]/</b@http://js.arcgis.com/3.20/init.js:108:172
.cache["dojo/Deferred"]/</n@http://js.arcgis.com/3.20/init.js:107:436
.cache["dojo/Deferred"]/</r@http://js.arcgis.com/3.20/init.js:107:203
.cache["dojo/Deferred"]/</d/this.reject@http://js.arcgis.com/3.20/init.js:109:488
.cache["dojo/Deferred"]/</b@http://js.arcgis.com/3.20/init.js:108:172
.cache["dojo/Deferred"]/</n@http://js.arcgis.com/3.20/init.js:107:450
.cache["dojo/Deferred"]/</r@http://js.arcgis.com/3.20/init.js:107:203
.cache["dojo/Deferred"]/</d/this.reject@http://js.arcgis.com/3.20/init.js:109:488
g/<@http://js.arcgis.com/3.20/init.js:1005:204
.cache["dojo/on"]/</n.once/f<@http://js.arcgis.com/3.20/init.js:122:420

0 Kudos
CCWeedcontrol
Regular Contributor

Did you ever find out what was wrong with your proxy?

I am having the same issue with WAB 2.4. Proxy worked fine in WAB 2.3 but now i get

This the error i get from proxy

"error":{"code":403,"messageCode":"GWM_0003","message":"You do not have permissions to access this resource or perform this operation.","details":[]}}

I made sure everything is set up properly. I followed the instructions here but no luck.

0 Kudos
BarnabyRockwell
Regular Contributor

Unfortunately, I still have no idea what the problem is....  Robert S. wrote that he may look into the issue soon....fingers crossed.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Well the bad news guys is that I just tested a 2.4 app that uses a secure service and configured my proxy.config with the username and password and I don't have any issue.

CCWeedcontrol
Regular Contributor

Robert thanks for looking into this. Can you post the httpProxy in the config.json  and the and proxy.config you are using. I am lost on why it doesn't work on 2.4.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Mine is much the same as what Barnaby posted except that I am using a secure map service and not a secure web map. So my proxy.config serverUrl point to my ArcGISServer url and not my orgs AGOL url.

0 Kudos
CCWeedcontrol
Regular Contributor

I figured out what what wrong with mine. No sure if its the same problem you have but after looking at my Chrome network in developer tools  i noticed that my proxy was getting stuck at' proxy.ashx?https://****.maps.arcgis.com/sharing/rest.. '

in my proxy config i had http://***.maps.arcgis.com, my proxy config file did not have 'https'. once i changed http to https in the proxy config it worked. Not sure why it's https. When i set up WEB 2.4 I put both http and https. My developer page shows my url as http not https.

I checked my 2.3 apps in Chrome network developer tools and the proxy is proxy.ashx?http://****.maps.arcgis.com/sharing/rest and that's why i had on my proxy config.

Not sure why it changed...?

anyway after 5 hrs of trouble shooting, hopes this helps.

BarnabyRockwell
Regular Contributor

Yes!  That was it.  WD 2.4 apps require https in both the config.json and the proxy.config for the AGOL URL.  

WD 2.3 apps require http, and will not work with https as far as I can tell.

JeffSauder
Occasional Contributor

I am getting a similar problem, I get the error "Unable to get property 'indexOf' of undefined or null reference" with a sad face.  Not sure what I could be doing wrong, I have the WAB application shared to Everyone in AGOL, the layer and map shared with the organization, and I've done this setup for proxy several times.  I've been trying just about everything for the last few weeks with no results.  My code is as follows:

Proxy.config:

<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*"
             mustMatch="true">
    <serverUrls>
        <serverUrl url="https://tog.maps.arcgis.com"
  username="<uname>"
  password="<pw>"
         matchAll="true"/>
 <serverUrl url="https://services.arcgisonline.com"
  matchAll="true" />
 <serverUrl url="https://gissvr"
  matchAll="true" />
    </serverUrls>
</ProxyConfig>

<!-- See https://github.com/Esri/resource-proxy for more information -->

json.config for the app:

  "httpProxy": {

    "useProxy": true,

    "alwaysUseProxy": false,

    "url": "http://gissvr/DotNet/proxy.ashx",

    "rules": [

      {

        "urlPrefix:":"https://www.tog.maps.arcgis.com",

        "proxyUrl":"/DotNet/proxy.ashx"

      }

    ]

  }

}

(gissvr is the name of the internal web server)

I've tried this with both clientid/secret and username/password, no change in results.

I tried setting all urls to https (not just AGOL ones), no change.

I have also tried hosting the app on my external web server, and setting this all up there (with the external ws name), and I have the same results there as well.

Is there something that I might not be looking at?  I've been through the documentation from ESRI, github, stackexchange, etc., to no avail.

I am just now starting with web appbuilder, so I didn't come from 2.3 version, so I can't say this was broken by 2.4.

Thank you for looking at this...

Jeff

0 Kudos