Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Ken Driscoll
Login Programmatically to Liferay through Portlet
2 de Julho de 2012 14:01
Resposta

Ken Driscoll

Ranking: Junior Member

Mensagens: 57

Data de entrada: 2 de Julho de 2012

Mensagens 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:

1
2MethodKey key = new MethodKey("com.liferay.portlet.login.util.LoginUtil", "login", HttpServletRequest.class, HttpServletResponse.class, String.class, String.class, boolean.class, String.class);
3PortalClassInvoker.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.
Yogesh Agrawal
RE: Login Programmatically to Liferay through Portlet
2 de Julho de 2012 23:00
Resposta

Yogesh Agrawal

Ranking: Junior Member

Mensagens: 32

Data de entrada: 17 de Maio de 2010

Mensagens recentes

Best way to implement custom login is by using AutoLogin.
see
1 FacebookAutoLogin.java
Bart Simpson
RE: Login Programmatically to Liferay through Portlet
2 de Julho de 2012 23:58
Resposta

Bart Simpson

Ranking: Liferay Master

Mensagens: 520

Data de entrada: 29 de Agosto de 2011

Mensagens recentes

Give this a try as well in your custom code
1com.liferay.portlet.login.util.LoginUtil.login
Yogesh Agrawal
RE: Login Programmatically to Liferay through Portlet
3 de Julho de 2012 02:25
Resposta

Yogesh Agrawal

Ranking: Junior Member

Mensagens: 32

Data de entrada: 17 de Maio de 2010

Mensagens recentes

Paul .:
Give this a try as well in your custom code
1com.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.
Jitendra Rajput
RE: Login Programmatically to Liferay through Portlet
3 de Julho de 2012 07:27
Resposta

Jitendra Rajput

Ranking: Liferay Master

Mensagens: 608

Data de entrada: 7 de Janeiro de 2011

Mensagens recentes

Try by creating custom login portlet in ext . In that case you can access LoginUtil inside your custom class.
Ken Driscoll
RE: Login Programmatically to Liferay through Portlet
3 de Julho de 2012 10:53
Resposta

Ken Driscoll

Ranking: Junior Member

Mensagens: 57

Data de entrada: 2 de Julho de 2012

Mensagens 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.