08-25-2023 10:21 AM
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.
08-25-2023 10:39 AM
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:
08-25-2023 10:40 AM
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"
08-25-2023 11:00 AM
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.
08-25-2023 11:03 AM
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.
09-21-2023 09:53 AM
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.
Explore our Alfresco products with the links below. Use labels to filter content by product module.