cancel
Showing results for 
Search instead for 
Did you mean: 

CORS Policy

jsiegesleitner
Champ on-the-rise
Champ on-the-rise

Hi,

When I want to add an Associtian between two nodes I get this error:

Access to XMLHttpRequest at 'http://192.168.56.101:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom1/nodes/012e9153-9511-41f0-8142-c4ad5d5a676f' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I have found three diffrent solution for this problem:

  1. When I write this cors-anywhere.herokuapp.com infront of the URL I want to use to add the Association
    But here is the problem that I just don't like this solution because of Security reasons (don't want to go into the internet)
  2. With the enablecors-1.0.jar that I have to copy into the $ALF_HOME/modules/platform folder, but I don't find the $ALF_HOME folder. Also I don't know where this Folder is supposed to be.
  3. That I turn down every web security of Chrome with the --disable-web-security. But here is the problem that it doesn't work and that I throw away every Security I have.

Maybe somebody has a better solution or can convince me to use one of the other three solutions.

My community edition is 5.2 and I am using a postgre SQL Database

Looking forward to your answers

Kind regards

1 ACCEPTED ANSWER

After much consideration and a lot of tests I came to the conclusion to use solution number 2 with the enablecors-1.0.jar file. Because this solution provides a solution and doesn't strip away every security.

View answer in original post

3 REPLIES 3

prachi_shah_c2
Confirmed Champ
Confirmed Champ

Hi Jonas Siegesleitner‌,

Regarding 2nd solution, ALF_HOME means location where your alfresco instance is installed. Like "/home/userName/alfresco-community/modules/platform".

Thanks,

Prachi Shah

ContCentric

Hi Parachi Shah,

Thanks for your fast reply.

Despite your informative answer, I can not locate the folders "modules" or "platform".

EDIT: I have found the folder "modules" but there is only a "share" folder, no "platform" folder. Do I have to copy the enablecors-1.0.jar into the share folder or do I have to create the folder platform and copy it there.

Thanks,

Jonas Siegesleitner

After much consideration and a lot of tests I came to the conclusion to use solution number 2 with the enablecors-1.0.jar file. Because this solution provides a solution and doesn't strip away every security.