AnsweredAssumed Answered

Pb : Add a ticket to an Alfresco url to avoid logging

Question asked by sam69 on Nov 7, 2006
Latest reply on Feb 26, 2007 by lalli
Hello !

I want to provide a link from my webapp, pointing to an Alfresco space or document.
But I want to avoid the user to login again (as the user is already logged on my website).
So the ticket url argument looks like what I need :

I manage to get a ticket through webservice, and append it to my url, but it  doesn't work.
Here is my test code :

//get ticket :
    String ticket = WebServiceFactory.getAuthenticationService().startSession("admin", "admin").getTicket();
    //remove "TICKET_" prefixe and add "?ticket="
    ticket = "?ticket=" + ticket.substring("TICKET_".length());
    String urlDetail = "http://dimension_1:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/66c17658-01fd-11db-ac8c-fd68b7f6067a" + ticket;
    String urlDownload = "http://dimension_1:8080/alfresco/download/attach/workspace/SpacesStore/66c17658-01fd-11db-ac8c-fd68b7f6067a/DojoToolkitInPractice.pdf'+ticket;
I got my 2 urls :
Just after, I past it in IE -> I have a servlet exception :

java.lang.IllegalStateException: Impossible de cr?er une sessionapr?s que la r?ponse ait ?t? envoy?e
Translation of the message : Unable to create a session after response has been sent.

And when I try the urls in firefox, I don't have an exception but I get the alfresco's identification screen. If I login, it show the right page.

I run the 1.4.0 version of alfresco on Windows XP Pro.

Does the ticket argument is working ? Somebody manage to get it work with a ticket obtain from web services ?