Can't apply edits to feature layer; 401 Unauthorized error

3338
3
10-20-2015 10:33 AM
AndyE
by
New Contributor II

Hi,

I'm having issues editing my feature service through a custom web app created with the developer version of web app builder.

I have a feature service in ArcGIS server, which I've added to my Portal as a feature layer, and then added to a web map. I can edit everything at this point without any errors, creating and updating features.

I can create an app in Portal, and still be able to edit everything without any issues.

As soon as I add this web map to an app built in the developer version of Web App Builder, using the standard edit widget. If I try and create or edit features I get 401 Unauthorized errors in Web AppBuilder:

"POST https://mymachine.domain.local:3344/proxy.js?https://arcserver.domain.local/arcgis/rest/services/Tes... 401 (Unauthorized)"

And when I deploy the app to a web server I get this error:

"XMLHttpRequest cannot load https:/?https://arcserver.domain.local/arcgis/rest/services/Test/TEST_Edits/FeatureServer/0/applyEdits. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource."

I'm using Windows authentication in both ArcGIS server and Portal with no signing in required. I can see all my content in the Web AppBuilder, including secured services. I have set up all my sites to use windows authentication in IIS and added CORS settings to every web.config file I can find (portal web adapter, arcgis server web adapter, and my app).

Is there anywhere I can look for logs files that might indicate why I can't edit from my custom web apps?

Does anyone know how can I get my custom Web Apps to work with my feature services?

Thanks

Andy

0 Kudos
3 Replies
AndyE
by
New Contributor II

I've had a minor success by adding the following proxy information to the config.json in a copy of my app deployed on the web server hosting the Portal web adapter (copied from an app created in and downloaded from Portal):

"httpProxy": {
  "useProxy": true,
  "url": "https://portal.domain.local/arcgis/sharing/proxy"
  }

The proxy above doesn't work at all for the apps in Web AppBuilder, or those I've deployed to my local IIS server. Is there anyway I can configure web app builder with this proxy?

0 Kudos
StephenBamford
New Contributor

Did you fix that issue? I have the same problem. I've tried what Andy suggested below and now the "401 Unauthorized" error disappeared but I get a very descriptive error:

init.js:182 Error: Unable to complete operation.(…)

I'm trying to create features on a SQL 2012 database using the editor widget. Any help ?   

0 Kudos
MarkCederholm
Regular Contributor II

I don't know if this is exactly the same issue, but I ran into the 401 error with a feature service on a non-federated ArcGIS server set up for web tier authentication (IWA).  The widget worked fine in IIS*, but in Web AppBuilder (Developer Edition) I would get the error.  I finally found the solution here:

Web-tier authentication—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers 

After I added the server name to the authorizedCrossOriginDomains array in the app's config.json, the problem went away.

*[Probably because it's on the same server as the feature service]