Token Security on an ArcGIS Server (Javascript)

12562
23
06-29-2011 01:26 AM
GrahamWhelan
New Contributor
Hello

I have a javascript application that connects to an ArcGIS server and does some functionality with the feature services. Today we added token based security to the rest end point which means I can no longer access it without the appropriate login details.

Can anyone provide a code example in javascript or point me in the direction of an example, of how to get a token using login details and store it/use it for a defined period of time. I cant find anything on the resource center.

Thanks in advance.

Graham
0 Kudos
23 Replies
JohnGravois
Frequent Contributor
if the global mustMatch policy in the proxy is set to "false" the proxy isn't evaluating URLs to confirm that they are in the list.  this means the 403 permission error is being generated by another component.

are you using the default application pool?
is Anonymous Authentication enabled for the app?
does it make any difference if you use 127.0.0.1 instead of localhost?  machinename?
0 Kudos
BrettGreenfield__DNR_
Occasional Contributor II
Yes to the first two questions, and no, it doesn't seem to make a difference if I try my machine name or 127.0.0.1.

Whew!  This is frustrating!
0 Kudos
JohnGravois
Frequent Contributor
this is just a shot in the dark, but you might check to make sure you have the following IIS components installed.

http://blogs.esri.com/esri/arcgis/2008/07/03/installing-on-windows-vista-and-windows-server-2008-whi...

also, i'm not sure what sites you are testing, but i've experienced intermittent problems bouncing tests off of google.

you're testing the following, correct?

http://localhost/[proxyfolder]/proxy.ashx?http://esri.com

is the error the same in all browsers?
0 Kudos
BrettGreenfield__DNR_
Occasional Contributor II
Thanks for all your help with this, John, but I told you it would be something stupid!  Turns out the proxy page files I had downloaded were from an older help page (http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jshelp_start.htm#jshelp/... once I downloaded the more up to date proxy page files, everything worked perfectly.
0 Kudos