AnsweredAssumed Answered

Share webscript 401 authentication issue

Question asked by muralidharand on Feb 28, 2013
Latest reply on Mar 1, 2013 by muralidharand
Hi experts,

I've developed a Repository post webscript without any authentication(i.e) <authentication>none</none>. Now, I want call this webscript from my share application,but I'm always hitting 401 error.


<webscript>
  <shortname>demo</shortname>
  <description>demo webscript</description>
  <url>/api/com/mywebscript/demo</url>
  <format default="json"/>
  <authentication>none</authentication>
  <transaction>required</transaction>
</webscript>



Alfresco.util.Ajax.request(
{
   url: Alfresco.constants.PROXY_URI +"api/com/mywebscript/demo",
   method: Alfresco.util.Ajax.POST,
   dataObj: dataobj,
   requestContentType: Alfresco.util.Ajax.JSON
});


If I hardcode the webscript URL, then it is working.


Alfresco.util.Ajax.request(
{
   url: "http://localhost:8080/alfresco/s/api/com/mywebscript/demo",
   method: Alfresco.util.Ajax.POST,
   dataObj: dataobj,
   requestContentType: Alfresco.util.Ajax.JSON
});


So, I wanted to know, how I can call webscript without any authentication?

I tried to look into api/login webscript, but I couldn't get much information from share application side.

Outcomes