Hello,
I have discussed a modification to the Esri Resource proxy that will allow for secured services to be printed.
Please see this discussion: Web AppBuilder Print widget and proxy service
Here is what I was able to come up with:
NOTE: These would only work for the DotNet version of the Esri resource proxy.
- Get the "Web_Map_as_JSON" (WMAJ) parameter (and data it contains) from the the request.
- Using a library like Newtonsoft.Json, deserialize the WMAJ data from a JSON object into a DotNet Object
- Get the "Operational Layers" section of the WMAJ object and add each layer into an array.
- Compare the Layer URL's of the layers from the WMAJ object and the URL's that are defined in the proxy.config file.
- If a layer's URL matches a URL from the proxy config file, use the credential info to generate a token for it.
- Apply the token to the layer in the array of "Operational Layers"
- Serialize the DotNet WMAJ object (now with tokens for the secured layers) and send the request on its way.
I hope this helps,
Chris