Web Appbuilder on my server gives white screen

2748
6
01-23-2017 09:54 AM
ElizabethMiller
New Contributor III

I have created a web appbuilder app online and successfully downloaded the code to my own server. The app is shared within my organization. When I access the site on my server fresh from the downloaded code I get the login dialog box but after putting in my arcgis online username and password the app lauches fine.

However, I then attempted to set up the proxy with a client id and client secret as I read in this forum that that was the way to get rid of the login dialog box for my organizational users. I have the proxy set up and I have tested it and it is working. I have registered the app on arcgisonline using my own site's url and I checked the radio button marked "Public" when registing the app. But now, when I lauch the app on my own server, I get the initial blue loading screen and then the screen just goes white -- no more login dialog, just nothing.

Can anyone help me get this app off the ground? Or help me understand why it isn't working?Robert Scheitlin, GISP or other gurus needed!

Thank you!

Tags (1)
0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Elizabeth,

   I know the whole desire to use the appid and app secret but I have found it to be a real pain and you can easily use username and password in the proxy.config instead.

0 Kudos
ElizabethMiller
New Contributor III

Thanks very much Robert,

I tried that instead but it didn't help -- I am starting to think the problems are caused by my organization's reverse proxy setup, although I have already tried to account for that and don't know what else to do.

My proxy.config has this:

<serverUrl url="http://<myorg>.maps.arcgis.com"
username="username"
password="password"
matchAll="true"/>

Here are a couple of other pieces of the mystery:

These work fine:

http://<myurl>/<mysite>/proxy/proxy.ashx?ping

http://<myurl>/<mysite>/proxy/proxy.ashx?http://services.arcgisonline.com

This is the url that errors out in my app:

http://<myurl>/<mysite>/proxy/proxy.ashx?http://<myorg>.maps.arcgis.com/sharing/rest/portals/self?f=json&dojo.preventCache=1485363849222&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback

BUT -- this works fine (same as above string without the proxy):

http://<myorg>.maps.arcgis.com/sharing/rest/portals/self?f=json&dojo.preventCache=1485363849222&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback

In my proxy.config I have tried both of these:

http://<myorg>.maps.arcgis.com/sharing/rest

http://<myorg>.maps.arcgis.com

In the reverse proxy config I have:

http://<myorg>.maps.arcgis.com

http://<myurl>/<mysite>/proxy/proxy.ashx

http://<myurl>/<mysite>

I don't know what else to try! Thanks for any ideas. I'm wondering if it is not possible to use Web AppBuilder with a reverse proxy.

proxies‌

 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Elizabeth,

   I use a Apache reverse proxy on my site as well so I can tell you that it does work in the mix.

Here are a couple of things. In my proxy.config I have:

      <serverUrl url="http://gis.calhouncounty.org" matchAll="true" />
      <serverUrl url="http://<my org>.maps.arcgis.com" clientId="??????" clientSecret="??????" matchAll="true" />

And the URLs that my web map uses all use my fully qualified domain name that goes through my reverse proxy.

So some questions:

  1. Is you web map public or secured?
  2. Does your orgs portal have allow anonymous access enabled?
  3. Do you have ArcGIS server secured layers in your web map?
  4. What error does htp://<your url>/<your site>/Proxy/proxy.ashx?htp://<your org>.maps.arcgis.com/sharing/rest/portals/self?f=json produce?
0 Kudos
ElizabethMiller
New Contributor III

Robert,

 

Thanks again. It seems that my proxy.config format matches yours.

 

Here’s what I’ve discovered so far:

 

The map/app on arcgis online is accessible to everyone (Public).

 

When I remove all the proxy directs from my config.json file, the app opens from my local server with no problem, and with no login dialog. As soon as I direct it to my proxy, it fails. But the proxy seems good when I try the tests I mentioned earlier.

 

If I leave the username and password in the entry for http://myorg.maps.arcgis.com in the proxy config file, then the error I get is a 500 error: “Failed to load resource: the server http://<my site> /proxy/proxy.ashx?http://myorg.maps.arcgis.com/sharing/rest/portals/self?f=json&doj... responded with a status of 500 (Internal Server Error).

 

If I remove the username and password in the entry for http://myorg.maps.arcgis.com in the proxy config file, then the error I get is a 403 error: “Failed to load resource: the server http://<my site> /proxy/proxy.ashx?http://myorg.maps.arcgis.com/sharing/rest/portals/self?f=json&doj... responded with a status of 403 (Forbidden).

 

 

Regarding your questions:

 

1. My map is shared with the public (Everyone).

2. My org doesn’t use Portal, just ArcGIS Online, and we do have a number of things that are shared publicly. So, I can’t find anything there that could be an issue.

3. I have one layer in the map coming from a publicly accessible ArcGIS server service that my org publishes. I can browse to the rest endpoint page fine through my own website proxy.

4. Using username and password (or client ID and client secret) the error is a 500 “Failed to load resource: the server responded with a status of 500 (Internal Server Error).

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Elizabeth,

   I need you to re look at questions 2 and 4.

You are not understanding what mean in #2. Your Orgs AGOL account is called a Portal. Then there is on premise Portal which is what I think you thought I was speaking of. Anyway on AGOL there is a setting in your orgs settings that allows for anonymous access. I want to know if your org has that checked or not?

And #4 If you did exactly what I asked and the result was an internal error then something is wrong with your proxy as I can do this using my proxy and orgs account and I get a json result. If you get your proxy to start logging then the proxy log might shed some light on this.

0 Kudos
ElizabethMiller
New Contributor III

I get your point regarding question 2 and I followed up on it. I checked the AGOL setting and yes, it allows for anonymous access.

As I mentioned above, I have tested my proxy using other urls such as 

http://<myurl>/<mysite>/proxy/proxy.ashx?http://services.arcgisonline.com

and it seems to work fine there. 

Thanks for your suggestions, maybe I can get the proxy to log more information.

0 Kudos