Web AppBuilder 2.2 register not working

2035
4
12-11-2016 01:54 AM
RamkumarNunduri
New Contributor

Dear Esri Support,

We are having ArcGIS Server 10.4 and ArcGIS Portal installed on the same system. There is an immediate requirement of having webappbuilder so I downloaded the Web AppBuilder 2.2 and tried to install it on a development system (IIS webroot directory). I followed the steps given in the installation of Web AppBuilder. The web appbuilder opens (http://mysystem:3344/webappbuilder) in the web browser (FF ver 46)  asking to enter portal URL and AppID.

I then logged into portal with portal admin privilege, in add item added the app (http://mysystem:3344/webappbuilder).

The problem comes once i start registering the app. The error shown up in the dialog reads as follows:

"unable to load https://<portalserver>/arcgis/sharing/rest/oauth2/registerApp status: 0"

Note:

In the firebug console window there is warning that

 CORS origin request blocked: The same origin policy disallows the remote resource at https://<portalserver>/arcgis/sharing/rest/oauth2/registerApp (reason: CORS header 'Access-Control-Allow-Origin' does not match 'http://<portalserver>, *'

I tried making several attempts giving different redirect URIs but was not successful. It need to get this thing resolved immediately.

Please Help Me.

Ram Kumar.

0 Kudos
4 Replies
DerekLaw
Esri Esteemed Contributor

Hi Ramkumar,

The error message returned in in Firebug,

> CORS origin request blocked: The same origin policy disallows the remote resource at https://<portalserver>/arcgis/sharing/rest/oauth2/registerApp (reason: CORS header 'Access-Control-Allow-Origin' does not match 'http://<portalserver>, *'

This part "'http://<portalserver>, *'" is odd. Portal for ArcGIS allows CORS requests by default, but does NOT use wildcards. The fact that the ‘Access-Control-Allow-Origin’ header includes a ‘, *’ at the end likely means it is being inserted by the web server where the Web Adaptor is installed. This is likely causing a mismatch and the web browser is blocking it.

The reason a CORS request is being made in the first place is because the Portal My Content page is being accessed over http. During the app registration process, the request to the oauth2/registerApp endpoint is always done over https. The easiest fix would be to simply access the My Content page over https. Or you could investigate the web server where the Web Adaptor is installed and try and determine what is adding the wildcard.

Hope this helps,

huangbinhua
New Contributor II

Good answer from Derek Law,thank you!

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

I think what Derek is saying (might be wrong) is that you need to make sure the https (and maybe http too) is registered with the AGOL AppID.  I have some tips on doing that /blogs/myAlaskaGIS/2015/01/15/tips-and-observations-for-getting-web-appbuilder-developer-edition-ins...   

That has some tips for getting the appid setup and starting WAB dev edition clean if needed.

DerekLaw
Esri Esteemed Contributor

Hi Rebecca,

The item you mention is not quite what I meant in my reply, but you do bring up another good item to check when deploying Web AppBuilder Developer Edition with Portal for ArcGIS.

Cheers,