Why wab dev 2.0 doesn't work with portal but 1.3 version does?

2543
8
07-19-2016 03:00 AM
ChrisPedrezuela
Occasional Contributor III

Hi guys, just curious what other steps to take when launching wab dev 2.0 with our portal? I use wab dev 1.3 and it works fine. We're using portal version 10.3. Would appreciate some advise. Basically I was able to set it up and use our portal URL. when I try to launch it from browser and connect to our portal it just returns with a blank screen without the usual web app builder menus.

thanks,

thanos

Tags (2)
0 Kudos
8 Replies
ChrisPedrezuela
Occasional Contributor III

I went in Chrome's dev tools and saw I was having some errors,

XMLHttpRequest cannot load https://portalhost/arcgis/sharing/rest/portals/…Evtc6zhHzj1iPH53qzHovgL_LN1KPtIkpIOUdxrg..&dojo.prev.... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3344' is therefore not allowed access. The response had HTTP status code 401.

Any insight guys how to address this? wab dev 1.3 doesn't seem to run into this problem.

Thanks,
Chris P

0 Kudos
DerekLaw
Esri Community Moderator

Hi Chris,

As far as I'm aware, Web AppBuilder Dev Ed v2.0 should work with Portal for ArcGIS 10.3.

- What authentication model is set for Portal for ArcGIS?

- Is your Portal working in a completely disconnected environment?

- Were any changes made to Portal or your network between using Web AppBuilder Dev Ed v1.3 and v2.1?

Hope this helps,

0 Kudos
ChrisPedrezuela
Occasional Contributor III

Hi Derek,

- No changes were made to our portal as far as I know, when I launch 1.3 it still works as expected. Only when I use 2.0 and now 2.1, I encounter the said XMLHttpRequest error.

- Our portal is working behind a firewall. We are a government organization.

- I think we are using web tier authentication, sorry I'm not an admin for our portal, but this is what I see on the cmd console when I launch WAB 1.3.

But since our portal works with 1.3, then I was assuming there was some authentication implementation change on 2.0 and 2.1. I read about CORS but I'm not that experienced in troubleshooting such stuff.

Is there a tweak we need to do in any of the config files of wab 2.0 or 2.1?

Thanks,

Chris P

0 Kudos
DerekLaw
Esri Community Moderator

Hi Chris,

> Our portal is working behind a firewall. We are a government organization.

If you're working in a disconnected environment, you will have to download the latest ArcGIS API for JavaScript v3.16 library and host them internally on a web server (that is accessible by the machine where you are running Web AppBuilder Developer Edition). Then, you will have to update the ArcGIS API for JavaScript libraries being referenced by Web AppBuilder Developer Edition v2.1 to that location.

FAQs—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers

Please see this question: Are portals with disconnected environments supported?

Yes. You must set your own apiURL manually in the env.js file. Refer to Change URL of ArcGIS API for JavaScript. By default, Web AppBuilder points to the ArcGIS API for JavaScript hosted by ArcGIS.com.

Hope this helps,

ChrisPedrezuela
Occasional Contributor III

Hi Derek, when you say disconnected, what does that actually mean? Apologies since Im a bit confused what the term means. Here in our organization we access internet thru a proxy server.we can access our agol accounts fine. If we use wab dev 1.3, it connects smoothly with our internal portal, w/c is why im a bit surprised the latest release has issues with our 10.3 portal.

0 Kudos
DerekLaw
Esri Community Moderator

Hi Chris,

> when you say disconnected, what does that actually mean?

Based on an earlier response, I was under the impression that your Portal is setup to work in a completely offline environment, meaning no access to the Internet. But your latest answer seems to suggest otherwise.

At this point, I am not sure what the issue is. Can you please contact Esri Tech Support and open an incident so they can investigate your issue in more detail?

0 Kudos
ChrisPedrezuela
Occasional Contributor III

Hi Derek,

After some research, I've come to some theory on what are issue here in our organization. Looking at the logs shown by the chrome dev tools, I am hitting an error on xmlhttprequest and messages like "No 'Access-Control-Allow-Origin' header is present on the requested resource". I've read some threads and it points to a situation when the app using JSAPI tries to check the server with the content if its enabled for CORS. If the server is not enabled for CORS, it trhows this error. I tested it using our organizational account in AGOL and wab dev 2.0 and 2.1 works, because I believe AGOL servers have CORS enabled. I suspect wab dev 1.3 does not check CORS enabled automatically which is why it runs fine with our portal. But wab dev 2.0 and 2.1 seems to have this configured by default.

My question is, if my suspicions are correct, how can I disable this CORS checking on the wab dev 2.x config settings? I've seen threads where the developers can do this on their custom js apps.

Thanks,

Chris

0 Kudos
DerekLaw
Esri Community Moderator

Hi Chris,

Apologies for the late reply, I was out on vacation the last couple of weeks.

> I suspect wab dev 1.3 does not check CORS enabled automatically which is why it runs fine with our portal. But wab dev 2.0 and 2.1 seems to have this configured by default.

I'm not sure if this is the case. Can you please contact Esri Tech Support so they can help you investigate further? If there is an issue I'd like for us to have a valid repro case so we can resolve this for Web AppBuilder.

Thanks,

Derek

0 Kudos