[SOLVED] Logout using REST fails
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2009 09:32 AM
For the logout it takes xml instead of json by default - don't know why - anyway how exactly must the xml look like? I tried giving it just the ticket in post parameters.
I always get 403 Forbidden as the http result code.
How should this be done?
(And maybe somebody could answer why some functions want json and some xml - this is a strange mix of formats…)
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2017 05:06 AM
Thanks for highlighting the issue.
well did u find the solution for this issue?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2009 06:27 PM
"/api/login/ticket/"+p_TicketSession + "?alf_ticket="+p_TicketSession
is working. I have submitted another URL with my ticket and the ressource is not anymore accessible. So it is working 🙂So forget my questions in my previous post 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 04:33 AM
I did:
In the .ftl it redirected to this url… Where ticket = TICKET_ce0049993f48b9996c48dd1e855c22dd8b24f97d
location = "http://seraecmdev001.sita.co.za:8080/alfresco/service/api/login/ticket/${ticket}?alf_ticket=${ticket}"
It returns:
<ticket>TICKET_862b5e324cbd5f7bfc4d84ea5fa74be70aebca3d</ticket>
But the ticket is still valid.
Could you please supply an example.
Thanks
Johan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 05:25 AM
Don't worry it does not seem stupid at all ! I had the same question !!
Here is a method (from a servlet) to require disconnection (code does not compile since it requires some other classes but it should be quite easy to clean it up). I use the library restlet - http://www.restlet.org/ - here (most classes in this code are coming from it )
public void disconnect(String p_TicketSession, String p_Login, String p_Password) { // Alfresco is over HTTP Client client = new Client(Protocol.HTTP); // URL for Alfresco (I'm using an external servlet so I have to get the URL to reach Alfresco) String urlRequete = getBaseUrlServicesAlfresco() + "/api/login/ticket/"+p_TicketSession + "?"+PARAM_TICKET+"="+p_TicketSession; // NOTE HERE THE METHOD USED FOR REST CALL : DELETE and not POST or GET Request request = new Request(Method.DELETE, urlRequete); // Calling Response reponse = client.handle(requete); Status status = reponse.getStatus(); int returnCode = status.getCode(); // Checking return code if ( returnCode == SUCCESS ) { logDebug("Disconnection succeeded"); } else { logDebug("Disconnection failed. Error code is : " + status.getCode()); throw new RuntimeException("Disconnection failed with http error code "+ status.getCode()); } }
Should make the work !
Boris

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 08:11 AM
I did:
location = "${url.context}/service/api/login/ticket/${ticket}?alf_method=DELETE"
Result:
<response>
−<status>
200
<name>OK</name>
<description>The request succeeded normally.</description>
</status>
−<message>
Deleted Ticket TICKET_9d42ac57c421c13c23af75c533bafdc3649d8003
</message>
<exception/>
<callstack>
</callstack>
<server>Enterprise v3.3.1 (96) schema 4,013</server>
<time>06 Oct 2010 1:50:37 PM</time>
</response>
which seems to work. But as soon as I press back button, it assigns a new Ticket without asking to log in, which I can delete again without asking for a login.
The user is not logged out as the user van still do queries…
Any ideas?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 09:07 AM
I ask this because your case seems to be : you delete the ticket and when pressing back, you automagically get connected with a new ticket (may be there are somewhere login/pwd and they are passed when you are not connected ?)
What you do to check this assertion (or discard it 🙂 ) is : get disconnected. Write the content of the ticket. Then Press back button and again disconnect. Another ticket is displayed. Compare the 2 tickets : they must be different.
What is the result of this test ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 09:10 AM
And I agree a new tickets is created. The 2 tickets differ.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 09:19 AM
Boris

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2011 04:29 PM
I have the same problem.
Thank you
