Access to fetch at ...

2375
2
08-30-2019 11:46 AM
anjelinaponkerat
Occasional Contributor II

Hi

i,m using Arcgisjava script on my local network and my server has not access to internet. when i load my website, I have this error in console:

Access to fetch at 'https://www.arcgis.com/sharing/rest/portals/self?f=json&culture=en ' from origin 'https://Localnetwork.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

0 Kudos
2 Replies
by Anonymous User
Not applicable

Hi Ponkerat,

May I understand how is your arcgis enterprise setup and where is your javascript is executed/deployed?

There are few possible way to overcome this issue,

Allow cors at your  portal.

Restrict cross-domain requests to your portal—Portal for ArcGIS (10.7 and 10.7.1) | ArcGIS Enterpris... 

Access through with esri resource proxy from your javascript.

GitHub - Esri/resource-proxy: Proxy files for DotNet, Java and PHP. 

Best Regards,

Than

0 Kudos
anjelinaponkerat
Occasional Contributor II

Hi

I have arcgis server 10.5 (that have not portal) in local network and I,m using arcgisjava script 4.12 that is published in my local network too. please help...

0 Kudos