CORS Policy

cancel
Showing results for 
Search instead for 
Did you mean: 
jsiegesleitner
Active Member

CORS Policy

Jump to solution

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 Solution

Accepted Solutions
jsiegesleitner
Active Member

Re: CORS Policy

Jump to solution

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 solution in original post

3 Replies
prachi_shah_c2
Active Member II

Re: CORS Policy

Jump to solution

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

jsiegesleitner
Active Member

Re: CORS Policy

Jump to solution

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

jsiegesleitner
Active Member

Re: CORS Policy

Jump to solution

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.