I have already tired passing the token along with the url like url+"?token="+token;
It works fine. But how can I use these in Query Task etc?
Do i have to use identity manager or odes the credentials property on Dynamic layer or feature layer work?
Setting up a proxy page is not an option.