Liferay’s unauthenticated remote service


Creating a new Liferay remote service that may be invoked by unauthenticated users


In a recent project, I had the need to expose most of the services of my application through WS. Security is enabled (that is the default in Liferay’s remote services) in all of the exposed methods. However, I had the requirement to make one of them invokable by unauthenticated users. This recipe explains how to achieve that.

How to

I’ll assume that you already have your service portlet modules and the corresponding service.xml as well as the entities defined within that file. In that case, all we need to do is to create the method in our ServiceImpl class and mark it with @AccessControlled(guestAccessEnabled = true), as such and execute the liferay:build-service goal (I’m using maven in this project):

@AccessControlled(guestAccessEnabled = true)
public String hello(final String name) throws SystemException, PortalException {
  return "Hello " + name;


No further explanations seem necessary for this recipe.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s