I'm using Arcgis server 10.3 and am having trouble using Print | API Reference | ArcGIS API for JavaScript
Some of my services are secured via tokens and I get access to my rest service directory through my webserver proxy. I am able to print unsecured services fine. Any secured services however return the error:
Unable to complete operation.
Error executing tool.: Layer "xyz": Failed to create layer from service at http.../MapServer/xyz. Failed to execute (Export Web Map). Failed to execute (Export Web Map Task).
If I directly copy the webmap JSON into the export task and run it this error also appears, leading me to believe this is a problem on the arcgis server side.
I found this relevant thread (Printing Secured Servies with Export web map task ) which seems to be my issue, but there is no apparent solution from there.