I've installed Alfresco Community 7.3 with docker, and I'm developing a frontend application with Angular.
It use a Tomcat webserver. When I try to execute a PUT or DELETE http call, server send back the following error: "status: 403, statusText: 'Forbidden".
The routine is the following (eg. for delete a document):
sAlfEliminaFile(ticket: string, idFile: string){ const headers = new HttpHeaders({ 'Authorization': 'Basic ' + btoa(ticket), }); return this.http.delete('/alfrescoapi/-default-/public/alfresco/versions/1/nodes/22f98143-eb5e-48f0-8c40-4534c1fe73d1', {headers : headers }) }
I'm using a proxy to avoid CORS problem, with following parameters:
{ "/alfrescoapi": { "target": "http://localhost/alfresco", "secure": false, "pathRewrite": { "^/alfrescoapi": "/api" }, "changeOrigin": true } }
I've already tried to change the param "changeOrigin" to false but it does not work. Credentials are corrects, I've also tried with admin credentials, with the same result.
What I can do to solve? Thanks.
I guess the problem is that service doesn't exist.
I created a workaround in this project:
https://github.com/keensoft/alfresco-remove-version
It's required to create a new Web Script (legacy REST API) in Repository to handle this DELETE invocations:
I addition... review your URL, since it looks incorrect.
This is the right one:
'/alfresco/api/-default-/public/alfresco/versions/1/nodes/22f98143-eb5e-48f0-8c40-4534c1fe73d1'
With an additional slash between "alfresco" and "api"
Thanks for your help,
the URL it's right, because I create an alias on proxy conf file
"pathRewrite": { "^/alfrescoapi": "/api" },
So, "alfrescoapi" is changed in "api". All'other API I developed work well.
Sorry, but I didn't understand your answer. May you explain me better?
This API is described in "Alfresco Content Services REST API" and the problem is the same for PUT method.
I solved by installing Alfresco on port 8080 instead of 80.
I don't know if NGIX reverse proxy has a specific rule for port 80.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.