How to bypass the message box that appears when calling a webscript
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2015 08:49 AM
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();
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2015 10:20 AM
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.
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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2015 07:28 AM
This works after removing authentication
