AnsweredAssumed Answered

Tickets getting lost?

Question asked by mcirwin on Apr 14, 2008
Latest reply on Nov 14, 2008 by libman
I have written a simple a small set of classes which make use of the Alfresco Web Services.  The unit tests all work when run inside Eclipse and I thought everything was fine.  I then bundled my classes in a SWT repository client and started to get the following exception:

Ticket could not be found when calling callback handler.

I am guessing that this simply means Alfresco is "forgetting" who I am.  How do I resolve this?  I am using the AuthenticationUtils to start the session and then just invoking the repository service.
Starting the session from one class:

    AuthenticationUtils.startSession(m_loginInfo.getLoginName(), m_loginInfo.getPwd());
    m_authDetails = AuthenticationUtils.getAuthenticationDetails();
and trying to use it in another (I have access to the authentication details here as well):
    RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();

    Reference spacesStoreRef = new Reference();
    spacesStoreRef.setStore(m_spacesStore);
    spacesStoreRef.setPath("/");

    QueryResult qr = repositoryService.queryChildren(spacesStoreRef);

    return getObjectImp(qr);

I tried re-writing the start session code to use the Authentication Service directly, as well as adding the ticket to the Repository Service.  Now the unit tests are failing witht he exact same problem.

    AuthenticationServiceSoapBindingStub authenticationService = WebServiceFactory.getAuthenticationService();
    m_authResult = authenticationService.startSession(m_loginInfo.getLoginName(), m_loginInfo.getPwd());
and trying to use it in another (I have access to the authentication result here as well):
    RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
    repositoryService.setPassword(m_ticket);

    Reference spacesStoreRef = new Reference();
    spacesStoreRef.setStore(m_spacesStore);
    spacesStoreRef.setPath("/");

    QueryResult qr = repositoryService.queryChildren(spacesStoreRef);

    return getObjectImp(qr);

How do I resolve this?  None of the examples I have looked at seem to show having to set tickets or anything.
What is the correct way to handle authentication?

Outcomes