cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco explorer authentication while down loading a file

chanduxyz
Champ on-the-rise
Champ on-the-rise
Hi All,
           I am working on Alfresco share.In that I have a requirement to download a file.When I download a file in share for the 1st time Alfresco Explorer is asking for admin authentication.Next time when I download it is not asking for any authentication.How can I resolve this issue(i.e 1st time also Alfresco Explorer should not ask for authentication when I download the file ). Could you please suggest me the way how to resolve it.Thanks a lot in advance Smiley Happy
18 REPLIES 18

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Is that out of the box code? Or is it your customization.

How did you configure Share (share-config-custom.xml)?

Regards,
Adei

chanduxyz
Champ on-the-rise
Champ on-the-rise
Hi All,
           I am working on Alfresco share.In that I have a requirement to download a file.When I download a file in share for the 1st time Alfresco Explorer is asking for admin authentication.Next time when I download it is not asking for any authentication.How can I resolve this issue(i.e 1st time also Alfresco Explorer should not ask for authentication when I download the file ). Could you please suggest me the way how to resolve it.Thanks a lot in advance Smiley Happy
Is that out of the box code? Or is it your customization.

How did you configure Share (share-config-custom.xml)?

Regards,
Adei

                   Thanks for reply Adei.I am uploading a file using a web script.I am recieving a download url from the server.Then when I click on that URL it is asking for admin authentication of alfresco explorer.To resolve it,I hope we need to identify for which WebScript/share components  the authentication is comming.
2) now for those calls pass the authentication ticket along with the WebScript.

To get authentication ticket:
1) use the login WebScript and pass the user name and password

But I don't know how to achieve it.Could you please suggest the way.Thanks again

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
How does the URL look like?

If you are uploading a file via webscript you'll need to have an authentication ticket, what you can do is append that ticket to the download URL so it looks such as:
http://my.alfresco.host:8080/alfresco/.......?alf_ticket=<my_ticket_value_here>

If that makes sense.

Keep in mind there are different authentication filters for webscripts:
* /service or /s: basic HTTP authentication
* /wcservice or /wcs: uses the user authenticated to the web client (explorer).


Regards,
Adei

chanduxyz
Champ on-the-rise
Champ on-the-rise
Thanks a lot Adei for your reply.

Can you please explain how can we get a ticket using web script (or) java based web script.and how can we add that ticket to the web script URL

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Hi chanduxyz,

You can get a ticket by colling the following webscript:

http:localhost:8080/alfresco/service/api/login?u=<username>&p=<password>

Adei

chanduxyz
Champ on-the-rise
Champ on-the-rise
Thanks Adei for your reply.I am able to get a ticket if I use "http:localhost:8080/alfresco/service/api/login?u=<username>&p=<password>".But I have some doubts here.
1)how can I append that ticket to my url dynamically
2)If I am able to append that ticket dynamically,how long that ticket will be valid.
3)If the ticket gets expire after 1 hour then I need to get a ticket and add it.It means getting a ticket one is not useful.So I need to get the ticket dynamically whenever I need.

So here my question is how can we get a ticket and append that ticket to the url dynamically

Your response is precious to me because I need to complete this issue ASAP.

Thanks in Advance

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Hi,

I'm not sure about how long is the ticket valid for…. Everything related to it you can find it here.

As you can see in there, once you get the ticket and call the download webscript, you'll need to append the ticket using the alf_ticket HTTP parameter with the ticket value.

To make sure the ticket is valid there is another webscript you can call.

http://localhost:8080/alfresco/service/api/login/ticket/{ticket}

Replacing {ticket} with the value of the ticket. If it's no longer valid you'll need to retrieve another ticket.

Hope this helps…

chanduxyz
Champ on-the-rise
Champ on-the-rise
Thanks a lot Adei for reply,

When I use "http://localhost:8080/alfresco/service/api/login?u=admin&pw=admin',I am getting the following ticket
<ticket>TICKET_ac05404b92507b3c0de118337cfb2ad2a57bccd2</ticket>
this ticket value I am appending to my download url like this ?alf_ticket=TICKET_43dcc87131e78653f0e76a7e2beb5510e11472d8.but still it is asking for authentication.

I dont know where it is wrong.

Could any body help me out please

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Which is the download URL you are using?