Select to view content in your preferred language

Aquiring Token

2914
12
05-14-2013 01:22 PM
JuneAcosta
Frequent Contributor
I have been spending too much time trying to create a token for my services with no success. Im hoping I can get the help I need from this forum since the ESRI Analyst that has helped me seemed just as confused.

Here's my scenario:
    I have ArcGIS server 10.1 SP 1 running on Amazon EC2 within a VPC(virtual private cloud).
    I have a customized version of the arcgis online simple map viewer (JSAPI)
    The IP address is 10.0.244.20- this is what I use to RDP to the instance (JSAPI)
    Both gismaps and gismaps.carlsbadca.gov are pointers to 10.0.244.20
    I tried using both the arcgis account and the AGS admin account for the token and had no luck

     webmap.itemData = {
          "operationalLayers": [
    {
      "url": "http://10.0.244.20/arcgis/rest/services/publicAGS/trafficStatus/MapServer/1",
      "id": "trafficStatusMobile_5116",
      "visibility": true,
      "opacity": 1,
      "title": "Carlsbad Boundary"
    },
 {
    "url": "http://10.0.244.20/arcgis/rest/services/publicAGS/trafficStatus/MapServer/0",
    //"id": "trafficStatusMobile_6847",
    "visibility": true,
    "opacity": 1,
    "mode": 1,
    "title": "Road Maintenance",


I need a 1 year token
    Do I create the token from my desktop or from the Amazon instance?
    Do I use HTTP Referer? IP Address? or IP address of this request's origin? If I use http Referer, what's the syntax for http referer:?
Tags (2)
0 Kudos
12 Replies
JuneAcosta
Frequent Contributor
I created the token with http referer and still got the login window with the new token. My incident with ESRI has been escalated and someone has finally contacted me. I hope I can get this resolved today. Of course, If you have other ideas, by all means let me know so I can try it.
0 Kudos
nicogis
MVP Alum
Have you tried to set in proxy a dynamic token?
0 Kudos
JohnGravois
Deactivated User
in a tech support call June and i were able to identify that she already had a valid long-term token stored in her proxy which allowed her to successfully retrieve secure content.

http://webserver/proxy/proxy.ashx?http://otherserver/arcgis/rest/services/Secure/MapServer

The reason she couldn't see her secure layer in her web app (based on ArcGIS Online "Basic Viewer" template) was because of this line in App.js

esri.config.defaults.io.alwaysUseProxy = false;    


Setting this property to true is a convenient request to force ALL the web traffic spawned by the application through the proxy (allowing the retrieval of secure content).  check out the following article for more information on different ways of working with secure services in JS applications.
0 Kudos