Select to view content in your preferred language

Secured services within webmaps with Flex Mobile 4.6

599
2
08-03-2012 05:54 AM
AntoonUijtdehaag
Deactivated User
I would like to use ArcGIS Online WebMaps within an mobile app (iOS/Android) build with Flash Builder 4.6 and the ArcGIS API for Flex 3.0. The webmap contains one or more secure operational map services. The webMapUtil.createMapByItem function ignores the token attribute and a login popup is presented. After supplying the usermane/password combination, ill get the correct map. The token was generated with the app:/myappname.swf HTTP referer, but that doesn't seem to matter. I'm using fiddler to check the communication. Here's a code snippet i'm using.

Does anyone have an idea how to use the webMapUtil in combination with tokens for secured mapservice within WebMaps?


var item:Object;
var itemData:Object;

item = {
      "extent": [
       [
        -139.4916,
        10.7191
       ],
       [
        -52.392,
        59.5199
       ]
      ],
      "snippet": "This map shows the Soil Survey Geographic (SSURGO) by the United States Department of Agriculture's Natural Resources Conservation Service.",
      "title": "Soil Survey Map of USA"
     };
     
     itemData = {
      "baseMap": {
       "baseMapLayers": [
        {
         "opacity": 1,
         "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",
         "visibility": true
        }
       ],
       "title": "World_Terrain_Base"
      },
      "operationalLayers": [       
      {
       "opacity": 0.75,
       "title": "Secured Service",
       "url": "http://(ip adres)/arcgis/rest/services/Secured/MapServer",
       "visibility": true,
       "token":"6HxoZNBhES7u4zfl-uEa84Z6CF0I8-1r8-OnOTLy8mKifupGCU2uxJMR-XcxsUN3cehGdqXg1nzW5kfIRX4CTw.."
      }
      ],
      "version": "1.1"
     };
     
     webMapUtil.createMapByItem(item, itemData);

  ]]>
   
Tags (2)
0 Kudos
2 Replies
DasaPaddock
Esri Regular Contributor
Try putting the token on the end of the url.

e.g.,

http://(ip adres)/arcgis/rest/services/Secured/MapServer?token=123
0 Kudos
AntoonUijtdehaag
Deactivated User
Try putting the token on the end of the url.

e.g.,

http://(ip adres)/arcgis/rest/services/Secured/MapServer?token=123


This works, thank You Dasa
0 Kudos