Alfresco Web Script Portlet rivet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2009 10:57 AM
AWPr is a JSR-168 portlet that can be used to expose remote Alfresco Web scripts, including those that need user authentication. With the help of a custom Alfresco authentication component that we wrote the portlet can carry the user credentials from the portal to Alfresco, authenticate the user in Alfresco and retrieve a ticket that can be used during all subsequent interactions between the end-user, the portlet and ultimately the Alfresco Web script itself.
Motivation for AWPr
When integrating Alfresco Web scripts with JBoss Portal or Liferay Portal AWPr alleviates the need for having to deploy all of Alfresco inside the portal as is the case when using Alfresco's OOTB (out-of-the-box) Web script portlet for Alfresco/Portal integration.
AWPr is also highly configurable. Through the use of portlet preferences you can create multiple instances of AWPr and configure each one with a different Web script URL and a set of parameters with default values if needed. The instance will then RESTfully fetch the result of the Web script's render phase and carry that over to the portlet finally rendering it on the screen within the confines of the portlet window.
It is hence possible to run two instances of AWPr on a single portal page where each instance is exposing a different Web script even if those Web scripts are hosted on two different Alfresco servers regardless of their geographic location.
AWPr lives here:
http://wiki.rivetlogic.org/display/AWPr/
Feel free to ask questions about AWPr in this thread.
–Alaaeldin
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2009 04:28 PM
I noticed that if I restart alfresco and liferay server and log in Liferay with userIdA (that is not in alfresco) I get the wished behauviour: the aWpr shows alfresco login interface.
If I log in with useridB (that is in Alfresco) awpr works fine because user is both in liferay and in alfresco. But if I log out and log in again with userIdA I get wrong behaouvior: I see my webscript, also if I shouldn't and at same time I get exception I said in previous post:
ERROR [web.scripts.AbstractRuntime] Exceptio
n from executeScript - redirecting to status template error: 08210143 Web Script
com/mine/quality/mywebscript.get requires user authentication; however, a gu
est has attempted access.
What I noticed is that the tickets generated are different between useridB and userIdB, so it's not a problem of caching or storing ticket.
Can anyone help me to understand?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2009 12:01 AM
You're seeing this behavior because it is how AWPr works. It was not intended for this use case. As a matter of fact the idea was that you should never see the Alfresco login screen inside an AWPr portlet so I'm curious as to how you were able to do that.
The way AWPr works is that it tries to authenticate with Alfresco as the logged-in portal user, and if a ticket cannot be created (i.e. login failed) then AWPr will attempt to access the configured webscript as a guest. That's why you're getting this exception.
–Alaaeldin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2009 04:37 AM
maybe because I disabled guestLoginAccess and my webscript has user authentication required?
Can I modify soure to change aWpr behaviour?
Thanks

Edit: I'm usign 1.0.0 version for aWpr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2009 10:17 AM
Yes you can. The code is quite simple. You need to modify the top portion of the JSPPortlet.executeScript(…)
if (alfTicket != null) { restParams.add(new NameValuePair(Constants.URL_PARAM_TICKET, alfTicket)); restParams.add(new NameValuePair(Constants.URL_PARAM_ALFRESCO_TICKET, alfTicket)); } else { restParams.add(new NameValuePair(Constants.URL_PARAM_GUEST, "true")); }
The else should be removed.
Hope this helps,
–Alaaeldin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2009 01:32 PM
I read that code portion, but there ticket is not null, even if alfresco user doesn't exist. This because JSPPortlet.java send always the same password "portal" that is recognized in SecureTokenAuthenticationImpl. I bypass it changing chaining-authentication-context.xml, but at the moment I can get only encrypted password from liferay and I can't do alfresco recognize user. Any suggestion?
Thanks for your attention

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2009 11:39 PM
–Alaaeldin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2009 04:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2009 10:41 AM
–Alaaeldin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2009 10:48 AM
Meanwhile I'm modifying aWPr portlet to get it working as I expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2009 11:22 AM
On the other hand AWPr is designed to seamlessly authenticate the portal user into Alfresco.
Sorry that I couldn't be more helpful.
–Alaaeldin
