cancel
Showing results for 
Search instead for 
Did you mean: 

loginticket built in web service

tsgpartner_mui
Champ in-the-making
Champ in-the-making
I was wondering how the loginticket built-in web script works.


Just by playing with it, I'm not quite sure what it is doing behind the scenes.  Correct me if I'm wrong.   But to my understanding, it calls two different methods - delete and get.  Both Having the same exact url, I believe the loginticket.delete.desc.xml is calling the loginticket.get.desc.xml to get the ticket which was entered in the url by the user, and then it deletes that ticket, which finally gives the user a 404 error, "ticket not found."


So for instance, I used the "login" built-in web service to establish a ticket.  Then, I used that ticket to be passed into the loginticket url.  When I tested this out with different users and passwords and with /alfresco/service/ or /alfresco/wcservice, I got mixed results.  Sometimes using the loginticket service, I was given the 404 error, which is suppose to happen, since to my understanding, thats the message to know that you have deleted the session.   And then, sometimes it would result to the ticket displayed in the xml ftl response template, which would mean, it didnt get deleted, but its still valid, right?  What I think is the cause could be the user I was logged as into in alfresco…



Anyway, what I want to do is to have two services that uses javascript:

1) would check if a particular session is still valid and

2) delete a particular session.   Again, to my understanding, the delete session ticket is already provided built in. 

And what I thought I could do is use the code similar to the "get" part of the loginticket service, but call the service with a different url like:

/sample/validate/ticket/{ticket}


But that didn't seem to work, giving me a 500 error stating a line of code in my xml ftl is undefined.  The ftl file is basically the same as the loginticket.get.xml.ftl




Any input would be appreciated.

Thanks.
15 REPLIES 15

tsgpartner_mui
Champ in-the-making
Champ in-the-making
I tried doing the append for delete

http://localhost:8080/alfresco/service/api/login/ticket/TICKET_49c9ef4623ea00d3d6c5085c25bd477a7936a...

still results in Ticket Not Found, shouldnt it return "Deleted ticket…"




And I tried entering the ticket for username if the box appear.  But it still returned the Ticket Not Found message.

davidc
Star Contributor
Star Contributor
ok, let me try.

tsgpartner_mui
Champ in-the-making
Champ in-the-making
Also testing it numerous times,

Ive come to realize that for the append,

at times it returns, Ticket Not Found, and then sometimes it returns, the same ticket in xml response.  This happens for admin and mark users.


I dont if its cacheing, but I closed the browser, and opened a new one.  These results still occur.

davidc
Star Contributor
Star Contributor
Ok, the alf_method argument is only respected on POST.  Not sure why it's like that, I just coded it that way at the time.

So, to test properly you'll need a html form to POST, or use another client like CURL to test.

I'll fix up alf_method so it's respected on GET too.

tsgpartner_mui
Champ in-the-making
Champ in-the-making
Alright, let me know when you get it respected on get.

So once you fix that, then you will be able to append it with alf_method=DELETE.

davidc
Star Contributor
Star Contributor