cancel
Showing results for 
Search instead for 
Did you mean: 

Show documents using new cmisatom url with a ticket

goebel
Champ on-the-rise
Champ on-the-rise
Hi

I need to access and show documents in the browser (jsf application with apache chemistry 0.8 client) which are stored in alfresco. With the old cmis url (alfresco/service/….), I generated a ticket for the user and appended it to the url the cmis client api returned.
However, after changing it to the new one 'alfresco/cmisatom', appending the ticket to the retrieved URL does no longer work.
I found a workaround where I could add a username 'ROLE_TICKET' and the ticket as password in the beginning of the URL 'http://ROLE_TICKET:ticket@localhost:8080/alfresco/' which works fine in google chrome and firefox. However in IE10 it does not work due to security reasons which is quite blocking.

I did a nasty workaround where I copy the document id from the cmisatom URL to an old url where appending the ticket still works. However this method is quite silly and as the old url is depreciated, i will face the same problem in future.

Does anybody know how I can or should change this ?

Thanks for any reply

Georges Goebel
4 REPLIES 4

jpotts
World-Class Innovator
World-Class Innovator
Why not write a proxy servlet. The user clicks a friendly download URL, which is your servlet. Your servlet grabs the object ID (or whatever unique ID you are using) and the user credentials or token you've already got in your session. The servlet can use the ticket in the username and password when it gets the session with the server, as you've already discovered. The servlet then downloads the file from the repo and streams the download to the browser.

Jeff

jrorke
Champ in-the-making
Champ in-the-making
I'm having this same issue.  Seems like it should be very simple to hit a content URL and provide a ticket, but I can't seem to get it to work.  Is the proxy servlet the best way to link to content using existing credentials?

I've tried all of these…

http://ROLE_TICKET:<my ticket>@alf-server:8080/alfresco/cmisatom/551526ad-183a-43ef-a513-c08880cfe591/content/calendar.jpg?id=workspace%3A%2F%2FSpacesStore%2F40d3246f-b8fd-4710-a848-8a3d78c6eb2c%3B1.0

http://alf-server:8080/alfresco/cmisatom/551526ad-183a-43ef-a513-c08880cfe591/content/calendar.jpg?i...<my ticket>

http://alf-server:8080/alfresco/cmisatom/551526ad-183a-43ef-a513-c08880cfe591/content/calendar.jpg?i...<my ticket>

http://alf-server:8080/alfresco/cmisatom/551526ad-183a-43ef-a513-c08880cfe591/content/calendar.jpg?i...<user name>&pw=<password>

jpotts
World-Class Innovator
World-Class Innovator
The ticket can be appended to the URL using the alf_ticket argument as shown below using the new CMIS URLs in 4.2.e:
<blockcode>
http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom/content/test1.txt?id=f1f4...
</blockcode>

Jeff

fgjohnson
Champ in-the-making
Champ in-the-making