REST Token service problem when using parameters in URL

3425
1
09-07-2010 06:50 AM
ujjwalnarayan
New Contributor
I have Arcgis server 9.3.1 set up with SQL server authentication and token service enabled. When i access a map service with just token passed in the Url (http: //myserver/arcgis/rest/services?token=....), i get authenticated properly. For example, the following url works.

http://miggisarcgis/ArcGIS/rest/services?token=YGJrmVR4_q_dBeL2DgeEXGWOkpQultJZ2psX3By9jNI4GOr-i-LfU....

When requesting html output explicitly via url parameter (http: //myserver/arcgis/rest/services?token=....&f=html), this also works without any problem.

http://miggisarcgis/ArcGIS/rest/services?token=YGJrmVR4_q_dBeL2DgeEXGWOkpQultJZ2psX3By9jNI4GOr-i-LfU...



However, when i request output in json format (http: //myserver/arcgis/rest/services?token=....&f=json) ,

http://miggisarcgis/ArcGIS/rest/services?token=YGJrmVR4_q_dBeL2DgeEXGWOkpQultJZ2psX3By9jNI4GOr-i-LfU...

I get the following error:

{"error":{"code":498,"message":"Invalid token","details":["Unauthorized access"]}}

Is this a bug in ArcGIS Server 9.3.1 or i'm doing something wrong? I am trying everything on a fresh install of ArcGIS server.

Please help!
0 Kudos
1 Reply
ujjwalnarayan
New Contributor
Got the solution from ESRI Support. Use IP address of client machine instead of the Http referrer to generate the token.