Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable CORS on GraphDB

Tags:

cors

graphdb

Everything in the question.
Additional info:

  • Working with Win 10, GraphDB free, 9.1.1 • RDF4J 3.0.1 • Connectors 12.0.2
  • I added in console => settings, graphdb.workbench.cors.enable / true + Set + restart
  • I also tried to set parameter "-Dgraphdb.workbench.cors.enable=true" under[ArgOptions] of file C:\Users\admin\AppData\Local\GraphDB Free\app\GraphDB Free.cfg + restart

and I still get "Access to fetch at 'http://localhost:7200/repositories/...from origin 'http://localhost:8080' has been blocked by CORS policy...

like image 430
Okilele Avatar asked Jun 19 '26 15:06

Okilele


2 Answers

The quickest way to enable the CORS functionality is to use these two Java parameters: ./graphdb -Dgraphdb.workbench.cors.enable=true -Dgraphdb.workbench.cors.origin=* Alternatively, you can add them to graphdb.in.sh / graphdb.in.cmd. To check what's the active configuration see:

Help > System information > Configuration parameters in the Workbench

like image 158
Sava Savov Avatar answered Jun 22 '26 21:06

Sava Savov


On Windows, I edited the file app\GraphDB.cfg and added those lines:

java-options=-Dgraphdb.workbench.cors.enable=true
java-options=-Dgraphdb.workbench.cors.origin=*

under the [JavaOptions] heading.

Then, rerunning GraphDB, and checking at http://localhost:7200/sysinfo should show, in the third tab "Config parameters", that CORS is indeed enabled:

graphdb.workbench.cors.enable          true   explicit 

graphdb.workbench.cors.expose-headers         default  

graphdb.workbench.cors.origin          *      explicit 
like image 29
lOlive Avatar answered Jun 22 '26 21:06

lOlive



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!