Cookies help us deliver our services.

By using our services, you agree to our use of cookies. Learn more

I understand

Starting from 6.2 version of Liferay the complete web service infrastructure (both SOAP and REST) is only available through user authentication.

This new solution seems to be safer but it could be a problem in case you need to expose services that do not require authentication; so let's see how to expose a REST service without authentication.

In a previous article (Don't expose a Liferay REST service) we have seen how, with a simple Java annotation, it's possible to keep a REST methodfrom being exposed through the Liferay web service infrastructure.

Annotations will be useful again allowing us to make a REST method accessible without user authentication; you just need to annotate the method in the *ServiceImpl Java class like this:

@AccessControlled(guestAccessEnabled = true)
public String publicMethod(...) {

Then you need to run the usual Ant target build-service and you're done!