AnsweredAssumed Answered

Javascript API Basemap Tiles Not Respecting Request Header

Question asked by hkoatnswps on May 27, 2018



For corporate security reasons, when we access our own map services in Javascript API (version 3.24 with AGS version 10.5), we need to include some token information in our requests, since all our requests go through a 3rd party security layer (called "Layer 7") first before the requests are forwarded to the Esri end-point.


We can get it working by adding token to the headers with this:


esri/request | API Reference | ArcGIS API for JavaScript 3.24 


And it works for say feature services. But it does not work well with basemap: the first call to basemap is successful, but when the tiles are fetched, we get a 401 authentication failure.


Here is the exact same error with some visuals:


ArcGIS JavaScript setRequestPreCallback is partially working? - Geographic Information Systems Stack Exchange 


Has anyone got it working with getting basemap tile requests to work with custom header?