Hi,
I have a web map with added two layers from two different ArcGIS servers. Both layers contain shared data as public data so suppose to be available to everyone.
ArcGIS Portal is installed on one of the mentioned servers. I created a web application in WebApp Builder where I use mentioned web map.
When I try to use the data from the layer which is stored on the same ArcGIS Server as the ArcGIS Portal then everything works fine. The problem begins when I try to use the data from the layer stored on the second server. I am asked for credentials even though the data is public.
QUESTION: How can I check with ArcGIS JS API is the data available to everyone or not? Is there any implemented in API function?
Did you just add the layer into your web map via the URL? If so then I'd recommend adding it as a content item in your Portal first and choosing the option to save credentials. That way the user name and password will be saved with the layer and you shouldn't get prompted for them when you add to a map or open the map.