Bug? arcgisUtils.createMap fails to create web map

4036
3
05-11-2015 12:25 PM
MichaelLacy
New Contributor III

In our own Portal for ArcGIS, I saved a map that contains multiple layers, including a map service layer with security restrictions.  I then shared the map to a group, but some of the people in that group do not have access to the restricted map service.

When the map is opened with the viewer in portal, it behaves as expected -- the map displays with all layers, except for the restricted map service layer.  However, when the map is loaded in our JavaScript API (v 3.13) app using arcgisUtils.createMap, the map displays with only the basemap layer.  Also, the then() function is never called, but no exceptions are thrown.  Looking at the web traffic in Fiddler, the web map json returned from the portal is correct, and it contains references to all the layers, including the restricted layer.  It looks like the individual layer services are then queried, and the restricted service returns a 403 status (as expected).

I tried to recreate the scenario using ArcGIS Online.  I uploaded a KMZ file, created a map, added the KMZ file to the map (along with other layers hosted on AGOL), and shared the map with everyone (but not the KMZ file).

http://www.arcgis.com/home/webmap/viewer.html?webmap=3bef75e7c0644ad88c6d979d9c1da394

It behaves the same way in the online viewer, but it successfully loads (minus the unshared KMZ file) in our JavaScript app as well.  I'm not sure why this example would work, other than it is a slightly different scenario -- a KMZ file hosted within AGOL, rather than an external map service. Anyway, the first scenario seems like a bug in the createMap API call.  Can anyone confirm this?

Thanks, Mike

0 Kudos
3 Replies
KellyHutchins
Esri Frequent Contributor

Have you loaded the esri/IdentityManager module into your app? If not try doing so. This module will handle displaying the log-in prompt for layers/maps that require credentials.

0 Kudos
MichaelLacy
New Contributor III

We're using Windows authentication, so there is no need to log in.  Some people will simply not be authorized to view some of the services, but they should still be able to see the layers for which they do have access.  The map viewer in the portal behaves this way, but it seems like createMap is failing when one of the services is unauthorized.

0 Kudos
sumitzarkar
Occasional Contributor

Kelly Hutchins

When we load the esri/IdentityManager module into app,The identity manger is shown for the secured layers however if user cancels the identity manger then the webmap is not loaded correctly you can see the Basemap but the operational layers are not loaded.

0 Kudos