cancel
Showing results for 
Search instead for 
Did you mean: 

How to bypass the message box that appears when calling a webscript

skumar_us
Champ in-the-making
Champ in-the-making
I have written a webscript to get the current logged in user.when I call this webscript it is prompting to enter the user name and password. Can this be ignored or by passed? How?

<webscript>
   <shortname>Get User Webscript</shortname>
   <description>Get User Id</description>
   <url>/com/ironmountain/getuser/GetUserWebscript</url>
   <authentication>user</authentication>
   <format default="json">any</format>
   <transaction>required</transaction>
</webscript>


<#escape x as jsonUtils.encodeJSONString(x)>
{
      "userId": "${userId}"
}
</#escape>


function main()
{
   var userId = person.properties.userName;
   model.userId = userId;
}

main();

2 REPLIES 2

mrogers
Star Contributor
Star Contributor
Its controlled via the authentication property.

http://docs.alfresco.com/4.1/concepts/ws-authenticating.html

However you are going nowhere if you want to return details of the currently logged on user.   

What you need to do is to log in first then call your script with a valid session key.

skumar_us
Champ in-the-making
Champ in-the-making
This works after removing authentication