Accessing Secure Content on ArcGIS Online from a Javascript App

Discussion created by beck3905 on May 22, 2013
I have created a JS Web Application that is consuming data from ArcGIS Online via a webmap.  I am trying to add a function to the app that would allow a user to export data as a shapefile or csv.  Because ArcGIS Online does not have the ability to use geoprocessing services that leaves me with the REST API Export Item operation.

Even though my data is shared with Everyone, I still need credentials to perform the export operation.  I have registered my app with AGOL and have an App ID and App Secret.  However, when I call the REST API Generate Token operation and receive a token using the App ID and App Secret, I receive and error saying that I do not have permission to perform the Export operation if I provide that token.  I have successfully done it using a token from logging in with my own username and password, but I do not want to store my username and password in the app for it to log in.

How can I associate my app with the content it would need to export?