Message Boards

Hot to add auth for a Service added in api/jsonws

Lucian Alexandrescu, modified 3 Years ago.

Hot to add auth for a Service added in api/jsonws

New Member Posts: 2 Join Date: 12/17/19 Recent Posts
Hi everyone, 
​​​​​​​I created the following class to  register a  service in /api/jsonws. The service and the method are registered  successfully. 
The problem is that the call is not authenticated. Can that be added through configuration or properties. I want to make the call just from a react portlet inside liferay.
This is my class:

@Component(
        property = {
                "json.web.service.context.name=announcements",
                "json.web.service.context.path=Announcement"
        },
        service = AnnouncementService.class
)
@JSONWebService
public class AnnouncementService {

    public static String getAnnouncements(final Long userId) {

        return "return something";
    };
}

Thanks!
thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: Hot to add auth for a Service added in api/jsonws

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts