cancel
Showing results for 
Search instead for 
Did you mean: 

Web script authentication

ben256
Champ in-the-making
Champ in-the-making
Hello,

I would like to access a webscript from Alfresco, and in this websript, I need to get the login (Alfresco login) of the user (which means get person.properties.userName through a template file). I've seen the 'person' node can be used in a webscript only when there is an authentication.

So here come my questions:

As the user connect after loging in Alfresco, can I make an automatic authentication to the webscript so that I will ba able to get his name, and the user does't need to enter his login and password again?

And second question: as I was testing this small application with different users, the authentication was required only for the first user: if I logout from Alfresco and login with a different user, the authentication for the webscript is not required and the userName I get is the one of the 1st user. I have to close my internet browser to get the authentication again. There is probably a simple solution to have the authentication each time, any idea?

Thanks
5 REPLIES 5

davidc
Star Contributor
Star Contributor
How are you referencing the web script from Alfresco?

If it's from the dashboard, the web script should pick up the user logged into Alfresco.

ben256
Champ in-the-making
Champ in-the-making
I was experimenting : I call the web script from a custom view using a template which displays a button.
The button call the web script:
Here is the code of template used in the custom view:

<table><tr><td><input type="button" value=" Launch " onclick=window.open("http://localhost:8080/alfresco/service/app_launcher/launch_appli.html")></td></tr></table>‍‍‍‍‍‍‍

Bad idea my button?

davidc
Star Contributor
Star Contributor
Replace /alfresco/service with /alfresco/wcservice

The Web Script should then hook up to the Web Client authentication.

See http://wiki.alfresco.com/wiki/Web_Script_Runtimes#Servlet_Runtime_.28HTTP_Access.29

ben256
Champ in-the-making
Champ in-the-making
It works perfectly
Thanks a lot

faisal
Champ in-the-making
Champ in-the-making
hi,

I have a webscript that forms a dashlet in alfresco. that webscript depending on which link the user clicks calls another webscript and the modifies a particular div tag with the response from another webscript. I am using /wcs instead of /service. My dashlet loads fine everytime, But the problem is when the user clicks a link sometimes the second webscript fails. What can be the reason behine this it is working most of the time but sometime when a user logs in triges to click a link in the dashlet it throws communication failure.

If somebody can suggest something that will be really helpful, I am really stuck with this one.

thanks in advance

Faisal