Fórum
Login not prompting when accessing portlet from external application
IGC SA, modificado 12 Anos atrás.
Login not prompting when accessing portlet from external application
Junior Member Postagens: 80 Data de Entrada: 08/06/11 Postagens Recentes
Hi, I'm trying to access a portlet from a external application and pass a parameter via the URL (?param=value).
I made use of the URL in the portlet's Configuration->Share tab, which in my case is:
http://localhost:8080/widget/web/prueba/publi1/-/importcomunidades_WAR_importcomunidadesportlet?actfor=114132GT040
I am able to retrieve the parameter using HttpServletRequest, but when I press the submit button on my portlet (which does some operations involving user creation and community creation) I get an exception. This is the most significant part of the trace:
As you can see, the Exception seems to be caused because there has been no previous user login, which is completely normal, but I am surprised that no Login screen prompted when I first tried to reach the portlet from outside. I expected a login portlet to appear and then, after I have submitted my credentials, direct access to the portlet (including the parameter).
How can I overcome this problem? How do I login before executing the portlet's action?
I made use of the URL in the portlet's Configuration->Share tab, which in my case is:
http://localhost:8080/widget/web/prueba/publi1/-/importcomunidades_WAR_importcomunidadesportlet?actfor=114132GT040
I am able to retrieve the parameter using HttpServletRequest, but when I press the submit button on my portlet (which does some operations involving user creation and community creation) I get an exception. This is the most significant part of the trace:
Caused by: com.liferay.portal.security.auth.PrincipalException
at com.liferay.portal.service.permission.PortalPermissionImpl.check(PortalPermissionImpl.java:42)
at com.liferay.portal.service.permission.PortalPermissionUtil.check(PortalPermissionUtil.java:40)
at com.liferay.portal.service.impl.GroupServiceImpl.addGroup(GroupServiceImpl.java:57)
As you can see, the Exception seems to be caused because there has been no previous user login, which is completely normal, but I am surprised that no Login screen prompted when I first tried to reach the portlet from outside. I expected a login portlet to appear and then, after I have submitted my credentials, direct access to the portlet (including the parameter).
How can I overcome this problem? How do I login before executing the portlet's action?
IGC SA, modificado 12 Anos atrás.
RE: Login not prompting when accessing portlet from external application
Junior Member Postagens: 80 Data de Entrada: 08/06/11 Postagens Recentes
Problem solved!!
It's as simple as placing the portlet in a private page of the community. The user is requested to login when trying to access the portlet and afterwards everything works fine (including parameter passing).
I wonder how other people would do to login if the portlet had to be necesarily placed in the public space of the community, fortunately that's not my issue .
It's as simple as placing the portlet in a private page of the community. The user is requested to login when trying to access the portlet and afterwards everything works fine (including parameter passing).
I wonder how other people would do to login if the portlet had to be necesarily placed in the public space of the community, fortunately that's not my issue .