cancel
Showing results for 
Search instead for 
Did you mean: 

Webscript Authentication

jett
Champ in-the-making
Champ in-the-making
I developed a Java-backed webscript referenced by a third-party viewer. The webscript takes a filepath as the parameter and what it does is pull the file specified in the parameter, stamps an image watermark on the file, and returns the modified stream back to the viewer. I currently set the authentication to "auth" but the problem is, the viewer (a Java applet) prompts me for the userid and password (HTTP Basic Auth). I tried changing authentication to "none" but I get an error message saying that I was not authenticated. (The behavior actually makes sense).

How do I get around this?

The only option I could think of is Authenticate from within the Java code – the problem with this is the approach opens up a security risk because users can just do a "view source" on the view page and see the parameters I pass to the script.
2 REPLIES 2

scouil
Star Contributor
Star Contributor
Hello,

You might want to have a look at the runas property then.
http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Freferences%2Fapi-ws-ru...
I've never used it myself but my understanding of it is that you could have a webscript without authentication to run with admin rights.

But then you need to be very careful not to let any injection hole in your code because it would execute with admin rights.

jett
Champ in-the-making
Champ in-the-making
Thank you. Will give it a shot.