AnsweredAssumed Answered

setRequestPreCallback is partially working

Question asked by brad_j on Aug 26, 2015
Latest reply on Aug 28, 2015 by RWinter85

I have an api sitting in front of AGS that requires it's own authentication. I am using setRequestPreCallback as stated by the ESRI docs.


In the image below, you can see that the first 2 requests are returning 200. The first request is CORS Preflight and the second request is the JS api getting the json info from the MapServer.


The second request uses the function I have set in setRequestPreCallback(...) to properly set a header value with the token. However, whenever an image is requested from the MapServer (via export), the function I have in setRequestPreCallback is not called and the token is not set, leaving me with a bunch of 401 Unauthorized requests.


Any ideas?


Feel free to answer on SO as well:


Message was edited by: Brad Janke