qbnsqbns

GenerateRendererTask and a token in the layer url

Discussion created by qbnsqbns on Nov 4, 2013
Hi,

In my JS app, whenever I use a layer from a secure Map/Feature Service I add a token to it:
For example:
var token = "sometoken";
var url = "http://mysecureserviceurl/someservice/MapServer/0?token="+sometoken;


I've never had any problems with it (every esri task I've used respects the token in the URL), until now when I tried to use GenerateRendererTask:

var generateRendererTask = new esri.tasks.GenerateRendererTask(url);
generateRendererTask.execute(...);


GenerateRendererTask strips all GET data from the url, adds it's own data and sends the request to the service. Of course the response code is 499 (token required), because there's no token in the GET data.

Is my only option creating a proxy that will add the token to the URLs?

Outcomes