cancel
Showing results for 
Search instead for 
Did you mean: 

problem accessing content after logging using webservices

lalli
Champ in-the-making
Champ in-the-making
I am using Alfresco V1.4 and working with webservice api.

From Alfresco Web Client, I created a user "lalli" and same password using admin rights. 
Now in my application I try to access a node after starting the session as below :

AuthenticationUtils.startSession("lalli", "lalli");

I am successfully logged in and when I try to access any node (eg :http://127.0.0.1:8080/alfresco/download/direct/workspace/SpacesStore/36136779-8421-11db-a9f8-cb5a7c3... – this user has access to read this file), It is again promting me to login.

I am not sure why its asking for logging even after logging thru my application ?  Even when i log in thru admin
AuthenticationUtils.startSession("lalli", "lalli");, accessing that node is asking me for a login.

In my servlet (in tomcat), i am using
response.sendRedirect(URL) to open my document in new window.  Here URL http://127.0.0.1:8080/alfresco/download/direct/workspace/SpacesStore/36136779-8421-11db-a9f8-cb5a7c3...


Is there any problem doing response.sendRedirect()?

Need this info urgently.

thanx in advance.
6 REPLIES 6

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

You need to put ?ticket=<ticketid> at the end of the download URL.

The ticket is in the response to the start session web service call.

Cheers,
Roy

lalli
Champ in-the-making
Champ in-the-making
Hi,

Thanx for the instant response.

I have one more query. 

I open this http://127.0.0.1:8080/alfresco/download/direct/workspace/SpacesStore/36136779-8421-11db-a9f8-cb5a7c3...<ticketID>

and in this a.doc, I have a link to another document which is also in the same space and accessible to the logged in user. 

Now the link has URL (http://localhost:8080/alfresco/download/direct/workspace/SpacesStore/9a79396f-8e82-11db-8023-cb60758...) and when I click on this link, it does not open the document and asks me for logging, but i have already logged in.

How do I append the ticket to this link which is in the document ?

I need this info urgently.

Regards,
Lalli.

lalli
Champ in-the-making
Champ in-the-making
any answer for my above question.

doblek
Champ in-the-making
Champ in-the-making
Hi,

As far as I know, which is not too much unfortunately, the ticket is valid for as long as the session is up… so the user should be logged as long as the ticket is valid…

Take a look at sam69 comments about "opened web service transaction" on this thread.
Maybe your problem is that you close the session after getting the ticket…

Regards.

lalli
Champ in-the-making
Champ in-the-making
Hi,

I solved the above problem where it was asking me to login inspite of logging thru webservices in my application.

The problem was the first document which I accessed used to return me the URL with the hostname (eg : http://abc.def.com:8080/…. ) instead of the IP (eg : http://10.1.1.1:8080/…) as my alfresco is running in Linux m/c.  Now in the first document, i had link pointing to the sec one which was absolute path (http://10.1.1.1:8080/.../b.html). 

Now i converted the hostname to the IP and my problem is solved 🙂

thanks.

alcazar
Champ in-the-making
Champ in-the-making
Hi lally:

I have the same problem with the hostname and IP name, how did you do to solve this problem?

Thanks in advance