Export Web Map With Token Secure GIS Services

4428
5
03-28-2013 05:41 PM
ShaunWeston
Occasional Contributor
I'm finding that the export web map tool does not work with GIS services that have token authentication, I've tried everything and it just doesn't work?

I've setup an export web map service and added in a server connection like it says here - http://resources.arcgis.com/en/help/main/10.1/#/Printing_maps_that_contain_secured_services/01540000...
I'm using the PSA account to connect to the secure gis service.

I then request a token (I've tried all methods - HTTP referer, Request IP, IP) for my Flex Viewer application and add it in. The application works ok and shows the layer, however when I go to export web map with this layer turned on it shows this in fiddler:

Unable to connect to map server at http://203.190.214.166/arcgis/rest/services/Masterton/UtilitiesInternal/MapServer?token=AgTh7DdcmY2M...




{"type":"esriJobMessageTypeError","description":"Token-based authentication failure."}

If I don't use this layer it works fine. If I don't use token authentication and use the identity manager to login it works fine. I just don't understand why this always shows an error, I just can't print with a secure service?

Tags (2)
0 Kudos
5 Replies
ShaunWeston
Occasional Contributor
Ok I've figured out the issue and a possible workaround...

I'm using a token with a client of HTTP Referer, which means that the token will only work if being passed from that url right? So this works fine for my flex application, so I request a token with the HTTP of gis.mstn.govt.nz and my application is hosted here gis.mstn.govt.nz/app. This shows the layers when go to the hosted application, but doesn't work if I run the application locally, which makes sense.

The issue is HTTP Referer works for showing/querying layers but doesn't seem to with the export web map gp task for some reason? However it does work using Request IP, so the web map task is not being referred by the application and needs to generate a local token. So the workaround is to use HTTP Referer for the layers and Request IP for the export web map task. So what I'm going to have to do is write into my python script to request a new token to each time export web map is requested and this will work! I've mucked around for ages trying to get this to work and this seems to be the only option.
0 Kudos
StephanieSnider
Occasional Contributor III
To provide more detail, here's what worked for me in ArcGIS Server 10.1 and ArcGIS Viewer for Flex 3.3.  I created a token for the "IP".  This IP address refers to the GIS Server or the Web Adaptor server - depending on which one you are pointing to for map services.  Add the token to the Flex Viewer Configure Layer window.  Configure the print widget as normal - providing the Export Web Map Task URL.  And it works.  Using the HTTP referer to create the token was fine with displaying the map services, but resulted in a connection error when using the print widget.
0 Kudos
Santhosh_KumarRamanathan
New Contributor

Hi,

I am experience the same issue but i am using javascript api instead for flex viewer.Can u guide me how to get token for print task using Request IP.

what i am doing now is token is generated from .Net proxy.but if i pass that i am getting error dojo.io.script.jsonp_dojoIoScript4._jsonpCallback({"error":{"code":400,"message":"Unable to complete operation.","details":["Error executing tool."]}});

0 Kudos
jonathanrobinson
New Contributor III

Hello, did you get this working?  I'm experiencing a similar issue from a deployed application from web app builder dev edition.

0 Kudos