Select to view content in your preferred language

Issue with invalid token

4439
0
10-25-2011 12:05 PM
VictorCiminera
New Contributor
I wasn't entirely sure whether to post this in the Flex forum or the REST API forum but since my issue is with an operational layer that I am accessing through the REST services API I figured this was the more appropriate forum.

I am accessing a secure service by passing a token generated by the token service in the query string for the REST URL.  I am generating the token using the ArcGIS web pages currently although I plan to use an HTTPS request from my application to retrieve the token for each user in the future.  Because my application is being deployed in the ESRI Flex Viewer I am specifying the "Client ID" as my IP address when creating the token.  I am generating the token and appending it to the URL for the service in the config.xml file for the viewer. 

Here's the issue; when I specify the URL using the machine name, it works just fine, however, if I specify the URL using the domain name I get an "Invalid Token" error with a fault code of 498.

Example (note that I am using http in this case because https will only work for the domain name that the certificate is registered for):

http://SERVER_NAME/ArcGIS/rest/services/SecureServices/SERVICE_NAME/MapServer?token=TOKEN

Works while

http://DOMAIN_NAME/ArcGIS/rest/services/SecureServices/SERVICE_NAME/MapServer?token=TOKEN

does not.

Any ideas?

Edit: Derp, ok, the answer is because when using the domain name I am routed differently from when I use the internal network name.  In one instance I arrive with an external IP address as my HostAddress and in another I arrive with my internal IP.
0 Kudos
0 Replies