cancel
Showing results for 
Search instead for 
Did you mean: 

Streaming content from Alfresco with anonymous access

spdaly
Champ in-the-making
Champ in-the-making
I am wrestling with 3.0 to pull images out of the the repo using web scripts.  I noticed that there is a new Javascript API for streaming content, but there isn't any documentation out yet.  So, I wrote a Java backed web script using the RandomSelectWebScript example on the wiki.

The web script works correctly after basic HTTP authentication.  I added the following

AuthenticationUtil.setCurrentUser("admin");

but Alfresco is prompting for authentication before it "hits" the Java class.

Any help would be greatly appreciated!
3 REPLIES 3

sbuckle
Champ in-the-making
Champ in-the-making
In the web script description file set authentication to "guest", e.g.


<webscript>
  …
  <authentication>guest</authentication>
</webscript>

Then whatever your web script URL you can also add on "?guest=true". That should allow anybody to access the web script.

spdaly
Champ in-the-making
Champ in-the-making
Thanks for the reply!

Would these changes work with a "standard" web script that pulls images??

sbuckle
Champ in-the-making
Champ in-the-making
It should do. It depends what you mean by "standard" Smiley Happy

You can also use the guest download content servlet. URL looks something like this:


/alfresco/guestDownload/<direct|attach>/<workspace>/<store>/<nodeId>/<filename>

There's more on the wiki page: http://wiki.alfresco.com/wiki/URL_Addressability

When you refer to the "new JavaScript API for streaming content" are you referring to the thumbnail service in 3.0?