I am new to ArcGIS JS API. I am trying to build logic to query a layer created by me. The intent is to build an analytic front-end. But, I am not able to access the layer without using the temporary token created for an app during development.
Right now, I do not have any other interest other than querying layer without manual login. How to access the layer? I am not able to figure it out as all samples do not have any authentication in front of them.
I have created a proxy service by creating an app but, the urls of layer server and proxy are different. I am not able to figure out how to configure esri.Config such that layer is fetched through proxy.
Solved! Go to Solution.
Getting the access to the layer to go through the proxy is a matter of proper proxy deployment and configuration and the proper setting of the esri.config.defaults.io.proxyRules and proxyUrl. The esri.config.defaults.io.proxyRules is an array of objects that have urlPrefix and proxyUrl properties. The urlPrefix would be the simple url to your secured map service.
The proxy.config must also contain the serverUrl that has the url for that same map service and mentioned earlier.
Thanks for the pointer. Just to confirm ArcGIS Online does not provide a proxy service and I have to set this up at another location.
Is my understanding correct?