Fórum

Login Programmatically to Liferay through Portlet

thumbnail
Ken Driscoll, modificado 11 Anos atrás.

Login Programmatically to Liferay through Portlet

Junior Member Postagens: 57 Data de Entrada: 02/07/12 Postagens Recentes
Hello, I am trying to let my portlet log users into Liferay through my custom login page in my portlet.

I have followed a response on this thread: https://www.liferay.com/community/forums/-/message_boards/message/11534052 but am still having issues.

I am using Liferay 6.1 GA1 and I am receiving no errors when it runs. However, it simply isn't logging me in.

Here is what I have:


MethodKey key = new MethodKey("com.liferay.portlet.login.util.LoginUtil", "login", HttpServletRequest.class, HttpServletResponse.class, String.class, String.class, boolean.class, String.class);
PortalClassInvoker.invoke(false, key, new Object[] { PortalUtil.getHttpServletRequest(actionRequest), PortalUtil.getHttpServletResponse(actionResponse), "user@test.com", "password", false, CompanyConstants.AUTH_TYPE_EA});


Please let me know if anyone else has had the same issue, or for any other ideas on how to get this working! I realize another way to do this is create an EXT plugin, but I would like to avoid this if at all possibly due to time constraints and the fact that I already have the rest of the login implemented in my portlet.

Thank you in advance.
thumbnail
Yogesh Agrawal, modificado 11 Anos atrás.

RE: Login Programmatically to Liferay through Portlet

Junior Member Postagens: 34 Data de Entrada: 17/05/10 Postagens Recentes
Best way to implement custom login is by using AutoLogin.
see
 FacebookAutoLogin.java
thumbnail
Paul ., modificado 11 Anos atrás.

RE: Login Programmatically to Liferay through Portlet

Liferay Master Postagens: 522 Data de Entrada: 29/08/11 Postagens Recentes
Give this a try as well in your custom code
com.liferay.portlet.login.util.LoginUtil.login
thumbnail
Yogesh Agrawal, modificado 11 Anos atrás.

RE: Login Programmatically to Liferay through Portlet

Junior Member Postagens: 34 Data de Entrada: 17/05/10 Postagens Recentes
Paul .:
Give this a try as well in your custom code
com.liferay.portlet.login.util.LoginUtil.login


Is it possible to use this method in custom portlet, as com.liferay.portlet.login.util.LoginUtil class is part of portal-impl.
thumbnail
Jitendra Rajput, modificado 11 Anos atrás.

RE: Login Programmatically to Liferay through Portlet

Liferay Master Postagens: 875 Data de Entrada: 07/01/11 Postagens Recentes
Try by creating custom login portlet in ext . In that case you can access LoginUtil inside your custom class.
thumbnail
Ken Driscoll, modificado 11 Anos atrás.

RE: Login Programmatically to Liferay through Portlet

Junior Member Postagens: 57 Data de Entrada: 02/07/12 Postagens Recentes
Could you or anyone else clarify on how I would go about creating a portlet in ext? Any links to examples would be greatly appreciated as well.

Jitendra Rajput:
Try by creating custom login portlet in ext . In that case you can access LoginUtil inside your custom class.