Hi David, In the TOC source, you will see src = this.rootLayer.url + '/' + this.serviceLayer.id + '/images/' + src; This line is only executed if the browser is IE. (For other browsers, they just inline the image as a PNG encoded in base64.) By adding our token as a query string parameter, we can make the URL work with secured services:
src = this.rootLayer.url + '/' + this.serviceLayer.id + '/images/' + src;
if (esri.id) {
// Support secured services too
var credential = esri.id.findCredential(src);
if (credential && credential.token) {
src = src + '/?token=' + credential.token;
}
}
This code is ** only moderately tested. ** It works on my machine!
... View more