cancel
Showing results for 
Search instead for 
Did you mean: 

Java backed web-script requires me to authenticate

marctsg
Champ in-the-making
Champ in-the-making
Hi,

I have a Java-backed web script I'm using to create new users in my repository.  The script is called by a front end application using Apache Commons' HttpClient, but I can't find a way to pre-authenticate with it the way I'm used to with JavaScript based ones by setting authentication headers in the request.  For now my workaround is to hard code some authentication into the script.

I would actually be a bit surprised if I had to get the authentication headers and perform the authentication myself, but I can't even find a way to do that.  Am I overlooking something in the deployment or development of my script?
3 REPLIES 3

jpfi
Champ in-the-making
Champ in-the-making
Hi,
you don't have to do the authentication yourself. Take a look here http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples
The authentication part in the web script framework is done before a the javascript or the java code is called. Be sure that you configured the authentication element in your desc.xml in the right way. In the most cases you should use
 <authentication>user</authentication>
Cheers, Jan

marctsg
Champ in-the-making
Champ in-the-making
Ahh darn it.  My face is red.  I've set this properly on all my JS backed web scripts, but somehow overlooked this on the Java one.  My face is certainly red.   Smiley Surprisedops:   Thanks for the help!

jpfi
Champ in-the-making
Champ in-the-making
No Prob…thats why forums exist., 4 eyes are better than 2 eyes 😉