Select to view content in your preferred language

CORS error with ExB Developer Edition and Enterprise

7173
12
Jump to solution
05-16-2022 01:18 PM
MarcBate
Frequent Contributor

When accessing ExB Developer edition via https://localhost:3001, and entering our ArcGIS Enterprise 10.9.1 address on the page https://localhost:3001/page/set-portalurl , it says "Your application domain is not allowed via Cross-Origin Resource Sharing (CORS) to access" then url of our portal web adaptor.

I tried to allow localhost in the Organization > Settings > Security page in the Portal, but it won't let me add it or https://localhost:3001

How do we use ExB Dev with our Enterprise server? I can only get it to work with AGOL.

Tags (1)
0 Kudos
2 Solutions

Accepted Solutions
AzinSharaf
Frequent Contributor

I am using my machine's fqdn (https://my_machine_fqdn:3001 and added this url to Portal security page. You may need use a CORS browser extension (link) as well to disable it. 

View solution in original post

MarcBate
Frequent Contributor

This does not work and is most likely not recommended. There is another post marked as the solution, i.e. use the FQDN instead of localhost when accessing the ExB Dev edition and add that to the list of Allowed Origins in Portal Organization Security settings page

View solution in original post

0 Kudos
12 Replies
GuillaumeArnaud
Frequent Contributor

Hi ! If you have frontal of webadaptator of portal on IIS, verify if param accept CORS. Look your web.config file. An example can be find here : https://docs.microsoft.com/en-us/iis/extensions/cors-module/cors-module-configuration-reference . The same thing is available for Apache.

Guillaume

0 Kudos
MarcBate
Frequent Contributor

This does not work and is most likely not recommended. There is another post marked as the solution, i.e. use the FQDN instead of localhost when accessing the ExB Dev edition and add that to the list of Allowed Origins in Portal Organization Security settings page

0 Kudos
AzinSharaf
Frequent Contributor

Editing web.config to allowing CORS is a Microsoft solution (the link Guillaume mentioned) and I can't say is not recommended unless you use "localhost" in web.config. 

I think using "allow origin" does the same thing in Portal. But regardless, you cannot use localhost on either of the solutions for security reason, 

0 Kudos
AzinSharaf
Frequent Contributor

I am using my machine's fqdn (https://my_machine_fqdn:3001 and added this url to Portal security page. You may need use a CORS browser extension (link) as well to disable it. 

boro
by
Occasional Contributor

Can you explain how you did this? If i try to add my FQDN to the list of Allowed Origins it starts complaining baout missing a domain name...

0 Kudos
DougSims_GT
Regular Contributor

If there is no domain in your entry, then it isn't a Fully Qualified Domain Name. You will need a full domain name for it to register correctly. 

Are you trying to do this on your desktop/laptop or on a server? 

0 Kudos
boro
by
Occasional Contributor

There is a domain name in the FQDN of my laptop (not sharing for obvious reasons), but I can't seem to get node.js to listen to it. Trying to connect to the FQDN + port results in a timeout whereas if i just use the machine name + port it will accept it (but ofc, since i have no domain name in that case, so it's still no help because i can't whitelist it in AGOL). Honestly I'm clueless right now

0 Kudos
DougSims_GT
Regular Contributor

Do you have the domain registered in DNS in your network settings? You should be able to ping your FQDN from the command line successfully.

You say you can't get node.js to listen to it, but your original post mentioned that you didn't have the domain entered into the allowed list (I assume in your portal settings). You can send me a direct message if you want to see if I can provide any more help with specifics (like domain names or IP addresses) that you don't want to post here. 

0 Kudos
boro
by
Occasional Contributor

changing localhost to localhost.com in my system32/hosts file did the trick... if only i knew before it was that simple. it's working for me! thanks for the offer of help though 🙂

0 Kudos