I'm attempting to access the legend of a secure service. Right now, if I go to the service itself via: http://<server>/ArcGIS/rest/services/Private/<mapservice>/MapServer?token=xyz123 I am able to access the map service, no problem.
If I go to: http://<server>/ArcGIS/rest/services/Private/<mapservice>/MapServer?token=xyz123/legend?f=json This does not work, and I am sent to the login page instead.
I have tried other iterations, like: http://<server>/ArcGIS/rest/services/Private/<mapservice>/MapServer/legend?f=json&token=xyz123 to no avail. I get {"error":{"code":498,"message":"Invalid token","details":[]}} in this case.
If I go to: http://<server>/ArcGIS/rest/services/Private/<mapservice>/MapServer/legend?f=json and login, I get my legend.
So it seems the legend is not accessible in secure map services using a token. So is this a bug? Or a "feature"?