I have a web script, 'GetDocuments', that returns a list of documents from a space that has CompanyHome as its top-level parent. In order to be able to "see" things under company home the webscript needs to be authenticated. I can set the authentication mode to user/guest/.. etc and when I execute the webscript from a browser it prompts me for a login, I enter the login details on the web form and it works fine - I get my list of documents.
I want to be able to call this webscript directly from a javascript client and I don't want to be prompted for login details. What I would like to be able to do is to call the 'login' webscript (service/api/login?u=admin&pw=admin) to get a ticket and then append the ticket to my 'GetDocuments' webscript (… &ticket=.TICKET_b8cfbdd9cc47ec9b24a7cdcb1f6a1ea9a13ee04e).
My questions are:
1. Is the above approach possible - using only scripting.
2. If not possible then is it possible to set the webscript up so that it does not require any authentication and then within the body of the webscript, prior do doing any repository access, login programmatically within the webscript so that it has access to repository?