0

This question originates due to I need to use LoginUtil.login() in my Liferay portlet. Well, to affect the login method from LoginUtil I should have HttpServletRequest, PortletRequest or something similar.

Could you explain me how I can get these objects in the JSON WS layer? Or probably there are another ways to practice digest authentication in Liferay 6.2?

informatik01
  • 16,038
  • 10
  • 74
  • 104
Vlad Dekhanov
  • 1,066
  • 1
  • 13
  • 27

1 Answers1

1

The Web Services layer in Liferay is actually quite separate from the request handling for Service Builder-generated REST calls. Liferay provides you with some information in the XXXServiceImpl class, notably the user information through this.getUser(), but you will not be able to access the actual HTTP request from here. If you need the raw request and have control over the URL you are calling, I would recommend creating a servlet (see Alain Dreese's comments here).

Community
  • 1
  • 1
Ben VonDerHaar
  • 281
  • 1
  • 4
  • 15
  • I just need to get access to the login method from LoginUtil. Unfortunately, i can't use default login portlet , and i want to use my custom portlet for perfoming logging. I tried to get access from service () method in the new servlet but i got classnot defined error or so. Probably you know way to do it? Thanks for attention. – Vlad Dekhanov Oct 16 '14 at 18:33