AnsweredAssumed Answered

Url Addressability-Direct download to no guest users

Question asked by sergio on Apr 12, 2007
Latest reply on Apr 20, 2007 by sergio
Hi all.

After reading carefully the wiki documentation about the URL Addressability some doubts remain.

My situation is the following:

I have a custom web application that access the Alfresco repository (Alfresco 1.4 but 2.0 in the very next future) calling custom web services published into the Alfresco installation itself. These web services are built on top of the Alfresco core APIs, are public available like other Alfresco ws and execute a specialised task upon the Alfresco repository objects, obviously each ws opens a new session, authenticates the current user, execute a task, then close the session. As a consequence, I suppose the user ticket is available only during the session itself and is automatically destroyed when the session is closed. My custom web application needs to access directly some contents in the Alfresco repository, for both viewing and downloading.

I would like to use the DownloadContentServlet passing a URL with the reference to the content to download, but….
Due to the authentication mechanism, the only way to perform this task is to provide a valid ticket as a parameter to the URL, but I think I am not allowed to do it because I don't have a valid ticket inside my custom web application. So, what other mechanism to download contents should I use?

I tried to use the GuestDownloadContentServlet, it works if and only if the Alfresco content is available to a guest user, but I don't have guest users in my custom web application, I have only registered ones.

So, what is the best solution for my problem?

Perhaps, should I write a custom Java class that uses the Alfresco APIs to authenticate a user and deploy it directly inside the Tomcat installation for my custom web app? Should this class create a new session with the logged user, get a user ticket, invoking the direct download servlet, then close the session?

Hoping someone could help me with this task,

all the best.