I'm about to change careers over this! I simply want to allow the user of a Web Application using the Javascript API (3.x) to download a shape file of the current extent. Simple, right? No!
Here's what I've done so far: I am using the following js code (which I got from a few posts on here):
var extractUrl = "http://mydomain/arcgis/rest/services/System/SpatialAnalysisTools/GPServer/ExtractData"
var layers = [app.mapView.map.getLayer(app.mapView.map.layerIds[1])];
var extractData = new ExtractData({
featureLayers: layers,
map: app.mapView.map,
analysisGpServer: extractUrl
}, "analysis-tool");
extractData.startup();
extractData.on("job-result", function (result) {
var resultLayer = new FeatureLayer(result.value.url || result.value, {
outFields: ['*'],
infoTemplate: new InfoTemplate()
});
app.mapView.map.addLayer(resultLayer);
});
On my ArcGIS Server Manager, I have opened up the SpatialAnalysisTools service for anonymous access. When I run the code, I get a login prompt. (when I put the url, with or without the proxy, in a browser there is no login and it works fine)

When I attempt to login, I get

I think the reason I'm getting the Unable to access is because it is building the tokens URL with https and my dev server isn't set up for https. I don't know how to get past that. But the main issue is that I don't want a login at all.
Further,

What's with the middle call? I'm wondering if that's what is causing the login.
I just have no ideas at this point. I just need some guidance.
Thanks in advance!