06-17-2019 09:32 AM
It's possible to allow Authorization Bearer token in alfresco requests? how can I do that?
When I try to reach any endpoint, ex: curl --header "Authorization: Bearer xxx.xxxx" http://localhost/alfresco/s/... I get this error:
"status" :
{
"code" : 401,
"name" : "Unauthorized",
"description" : "The request requires HTTP authentication."
},
"message" : "05170011 Authorization 'Bearer' not supported.",
"exception" : "",
"callstack" : [ ],
"server" : "Community v6.0.7 (r2ba893dd-b113) schema 10,201",
"time" : "Jun 17, 2019 1:20:03 PM"
Thanks.
06-19-2019 04:28 AM
Hi T Dias,
To me this means your clients requests land on the alfresco servlet container with an HTTP "Authorization" header of type "Bearer".
This type is not recognized by Alfresco out-of-the-box, hence the message.
You may have this authentication type set either by your client or by a reverse proxy in between?
Maybe can you clarify how you installed Alfresco and how is it integrated with other services?
Regards,
06-27-2019 06:55 AM
Hi Alexandre Chapellon,
Thanks for your answer.
I found that you added a topic about "Collaborative Edition on Alfresco using LibreOffice Online", that is more or less what I'm trying to accomplish.
The problem that I found is that libreoffice add an Authorization header of type bearer in the request send to alfresco.
My environment:
Any idea about this?
Regards
04-28-2021 05:04 AM
Have you found a solution?
04-28-2021 04:02 PM
Hello,
Instaed Bearer you should use the alf_ticket param in your curl call. First thing you do is call the login web script to get a ticket.
curl -v "http://localhost:8080/alfresco/service/api/login?u=admin&pw=yourpassword"
Alfresco will respond with something like:
TICKET_e46107058fdd2760441b44481a22e7498e7ddfsf
Now you can take that ticket and append it to your subsequent web script calls.
Then post it to the web script using curl, like this:
curl -v -X POST "http://localhost:8080/alfresco/service/someco/someScript?alf_ticket=TICKET_e46107058fdd2760441b44481a22e7498e7dbf66" -H "Content-Type: application/json" -d @/Users/arjunm/test.json
Explore our Alfresco products with the links below. Use labels to filter content by product module.