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:
Thanks!
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!
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
Hi,May be Service Access Policy Help you https://help.liferay.com/hc/en-us/articles/360017896072-Service-Access-Policies