09-05-2024 05:03 AM
Hi,
I'm trying to use REST API of ACS 7.2 just like I was doing with the 5.2
I successfully retrieve a ticket
curl -X POST "http://test-gedi/alfresco/api/-default-/public/authentication/versions/1/tickets" -H "accept: application/json" -H "authorization: Basic SkMyMDUyMzY6VGFyZHlmZXJvbjgwbWch" -H "Content-Type: application/json" -d "{ \"userId\": \"myuser\", \"password\": \"mypassword!\"}"
{ "entry": { "id": "TICKET_864ca3ef4000c43701d275b7704c6b57ccf0e842", "userId": "myuser" } }
then I code it in base64
But when I try to curl with this ticket (here is another one but)
curl -X GET -H 'Accept: application/json' -H "Authorization: Basic VElDS0VUXzg2NGNhM2VmNDAwMGM0MzcwMWQyNzViNzcwNGM2YjU3Y2NmMGU4NDI=" "http://test-gedi/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?maxItems=5"
I get a 401 error
<html><head> </head><body><p>Login failed. Please try again.</p> </body></html>
When I Try to activate
with this url
curl -X GET "http://test-gedi/alfresco/api/-default-/public/authentication/versions/1/tickets/-me-" -H "accept: application/json" -H "authorization: Basic SkMyMDUyMzY6VGFyZHlmZXJvbjgwbWch"
I get a maybe interesting error :
{ "error": { "errorKey": "Ticket base authentication required.", "statusCode": 400, "briefSummary": "08050005 Ticket base authentication required.", "stackTrace": "Pour des raisons de sécurité, le traçage de la pile n'est plus affiché, mais la propriété est conservée dans les versions précédente", "descriptionURL": "https://api-explorer.alfresco.com"
}
}
My code is perfectly working with 5.2 so I guess I missed a configuration somehow ..
It seems that authentification with ticket need to be activated/enable somewhere..
I'm user docker image ..
Could anybody help ?
thank you !
09-08-2024 11:22 PM
Hello,
@JC83 wrote:Hi,
I'm trying to use REST API of ACS 7.2 just like I was doing with the 5.2
I successfully retrieve a ticket
curl -X POST "http://test-gedi/alfresco/api/-default-/public/authentication/versions/1/tickets" -H "accept: application/json" -H "authorization: Basic SkMyMDUyMzY6VGFyZHlmZXJvbjgwbWch" -H "Content-Type: application/json" -d "{ \"userId\": \"myuser\", \"password\": \"mypassword!\"}"
Download{ "entry": { "id": "TICKET_864ca3ef4000c43701d275b7704c6b57ccf0e842", "userId": "myuser" } }
then I code it in base64
But when I try to curl with this ticket (here is another one but)
curl -X GET -H 'Accept: application/json' -H "Authorization: Basic VElDS0VUXzg2NGNhM2VmNDAwMGM0MzcwMWQyNzViNzcwNGM2YjU3Y2NmMGU4NDI=" "http://test-gedi/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?maxItems=5"I get a 401 error
<html><head> </head><body><p>Login failed. Please try again.</p> </body></html>When I Try to activate
with this url
curl -X GET "http://test-gedi/alfresco/api/-default-/public/authentication/versions/1/tickets/-me-" -H "accept: application/json" -H "authorization: Basic SkMyMDUyMzY6VGFyZHlmZXJvbjgwbWch"
I get a maybe interesting error :
{ "error": { "errorKey": "Ticket base authentication required.", "statusCode": 400, "briefSummary": "08050005 Ticket base authentication required.", "stackTrace": "Pour des raisons de sécurité, le traçage de la pile n'est plus affiché, mais la propriété est conservée dans les versions précédente", "descriptionURL": "https://api-explorer.alfresco.com" } }
My code is perfectly working with 5.2 so I guess I missed a configuration somehow ..
It seems that authentification with ticket need to be activated/enable somewhere..
I'm user docker image ..
Could anybody help ?
thank you !
To resolve the authentication issue in Alfresco ACS 7.2, double-check the ticket encoding, verify ticket expiration, and ensure ticket-based authentication is enabled in the docker image configuration.
09-08-2024 11:43 PM
Thanks for the answer
That is exactly what I'm trying to do ..
double-check the ticket encoding -> base64, checked ok
verify ticket expiration -> one year
and ensure ticket-based authentication is enabled in the docker image configuration -> I don't find anything in the docker image configuration related to this. How to enable ticket base authentication ???
09-09-2024 07:06 AM
I have exactly same issue when connecting from inside the alfresco container
[alfresco@a1a4850d2685 tomcat]$ curl -X GET -H 'Accept: application/json' -H "Authorization: Basic VElDS0VUXzFmNTc5YTQwYTE2ODRiNjhmMmQ0YTM2ODg2OTc0MDMyYWRiYzg5Njk=" "http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?maxItems=5" -v * About to connect() to localhost port 8080 (#0) * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 8080 (#0) > GET /alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?maxItems=5 HTTP/1.1 > User-Agent: curl/7.29.0 > Host: localhost:8080 > Accept: application/json > Authorization: Basic VElDS0VUXzFmNTc5YTQwYTE2ODRiNjhmMmQ0YTM2ODg2OTc0MDMyYWRiYzg5Njk= > < HTTP/1.1 401 < WWW-Authenticate: Negotiate < WWW-Authenticate: Basic realm="Alfresco Server" < Content-Type: text/html;charset=UTF-8 < Content-Length: 80 < Date: Mon, 09 Sep 2024 14:03:27 GMT < Server: < <html><head> </head><body><p>Login failed. Please try again.</p> </body></html> * Connection #0 to host localhost left intact [alfresco@a1a4850d2685 tomcat]$
09-09-2024 07:29 AM
when connecting from the production server (still in 5.2), it works and we can notice that there is no line with "WWW-Authenticate" in the answer
[root@capella classes]# curl -s "http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/people/RS139234" -H 'Authorization: Basic VElDS0VUX2IxODg2OTliYjc3ZDBmNjI0MGM3ZDBlOTZmNzhjMGM3NThkYzUxYzc=' -v * About to connect() to localhost port 8080 (#0) * Trying ::1... * Connected to localhost (::1) port 8080 (#0) > GET /alfresco/api/-default-/public/alfresco/versions/1/people/RS139234 HTTP/1.1 > User-Agent: curl/7.29.0 > Host: localhost:8080 > Accept: */* > Authorization: Basic VElDS0VUX2IxODg2OTliYjc3ZDBmNjI0MGM3ZDBlOTZmNzhjMGM3NThkYzUxYzc= > < HTTP/1.1 200 OK < Server: Apache-Coyote/1.1 < Cache-Control: no-cache < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Pragma: no-cache < Content-Type: application/json;charset=UTF-8 < Content-Length: 294 < Date: Mon, 09 Sep 2024 14:24:18 GMT < * Connection #0 to host localhost left intact
Explore our Alfresco products with the links below. Use labels to filter content by product module.