Token Security on an ArcGIS Server (Javascript)

Discussion created by gwhelan-esri-ireland-ie-esridist on Jun 29, 2011
Latest reply on Sep 4, 2012 by bgfield

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.