RE: Very Simple JSON REST service in Liferay CE 7.1.2 GA3

Dennis Schilakowski, modified 6 Years ago. New Member Posts: 15 Join Date: 2/15/19 Recent Posts
Hello everybody,
I would like to implement a really simple REST service which can be reached without authentication.
Yes he should be public :-).

The "rest" template from the Liferay IDE creates a JAX-RS which would be the right approach and my favorite, unfortunately I can not reach the service without authentication.

Does anyone have an idea how I can deactivate the authentication for a certain context or it exists even an alternative to the JAX-RS?

Many Greetings,
Dennis
thumbnail
Christoph Rabel, modified 6 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
You have two options:
-) Create a 7.0 rest service. It still works in 7.1
-) Add the necessary properties for anonymous access:


@Component(
    property = {
        JaxrsWhiteboardConstants.JAX_RS_APPLICATION_BASE + "=/greetings",
        JaxrsWhiteboardConstants.JAX_RS_NAME + "=Greetings.Rest",
        "oauth2.scopechecker.type=none",
        "auth.verifier.guest.allowed=true",
    },
    service = Application.class
)


https://community.liferay.com/de/forums/-/message_boards/message/112794830
Dennis Schilakowski, modified 6 Years ago. New Member Posts: 15 Join Date: 2/15/19 Recent Posts
Thanks you! It's working fine.