Direct url to download document
Hello, I want to download a document in Nuxeo from an another application. I trry an url : http://nuxeo_server:8080/nuxeo/nxfile/default/9f8c190a-dd27-4d77-9c0a-a3b4cd95abbc/file:content/DEMABOX000000137.pdf Nuxeo need a login and a password. How to download Anonymous the file ? Thanks Benoit
Hi guys,
Nuxeo requires always authentication each request, by default. But, as Yousuf says you can use EasyShare link to download with anonymous auth as well. EasyShare use an unauthenticated URL, you can find below: https://doc.nuxeo.com/display/NXDOC/Authentication+and+User+Management. So, I think If you need that another applications download documents with no auth, you can contribute to a new unauthenticated URL and create a CoreSession instance with an user principal (ie. downloader) to get the document and attach to response.
You can find how to do a contribution for that, here: https://doc.nuxeo.com/display/ADMINDOC/Authentication,+Users+and+Groups#Authentication%2CUsersandGroups-AdvancedAuthenticationSchemes
And examples for openUrl of EasyShare: http://explorer.nuxeo.com/nuxeo/site/distribution/current/viewContribution/org.nuxeo.easyshare.auth.contrib--openUrl
I hope that helps to you.
Regards, VS!
Hello Yousuf, Thanks for the reply, I'll try the solution tomorrow. And if I don't use Share-it function, is-it possible to pass in the URL the login and password? If yes, can-you give me an example? Thank you Benoit
Hi Benoit,
Have you tried this? https://doc.nuxeo.com/display/USERDOC/EasyShare
Maybe that helps.
Thanks,
Yousuf