cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED]call webscript from dashlet - 401?

targa2000
Champ in-the-making
Champ in-the-making
trying to call a webscript in the repository from a dashlet and get 401 error

HTTP Status 401 - This request requires HTTP authentication

the webscript itself doesn't require authentication

I've even given a user and password to the url but still I get the same error.

   var connector = remote.connect("alfresco");
   //var data = connector.get("/api/people?filter=" + username);
   //var data = connector.get("/someco/whitepapers");
   //var data = connector.get("/someco/whitepapers?username=admin&password=admin");

   var data = connector.get("/someco/whitepapers.html");
   
   java.lang.System.out.println("data: " + data);

any recommendations?
2 REPLIES 2

targa2000
Champ in-the-making
Champ in-the-making
I see. I receive the 401 error when I try to test the dashlet via url

http://localhost:8080/share/service/demo/whitepaperviewer

but it runs fine when I run the dashlet inside share.

rafaelscg
Champ on-the-rise
Champ on-the-rise
You could to pass ALF_TICKET with your URL like:

http://localhost:8080/alfresco/service/mywebscript?[ALF_TICKET]

Get ticket by access:

/alfresco/service/api/login?u=<uname>&pw=<pwd>

Let me know if this works for you.

Best regards