Foros de discusión

Liferay 6.2 custom login portlet

thumbnail
Vitaliy Koshelenko, modificado hace 10 años.

Liferay 6.2 custom login portlet

Expert Mensajes: 319 Fecha de incorporación: 25/03/11 Mensajes recientes
Hi, everybody!

I'm developing custom login portlet.
Here is code fragment, where I try to log in user:

ClassLoader pcl = PortalClassLoaderUtil.getClassLoader();
            Class lClass = pcl.loadClass("com.liferay.portlet.login.util.LoginUtil");
            Method method = lClass.getDeclaredMethod("login", HttpServletRequest.class, HttpServletResponse.class, String.class, String.class, Boolean.TYPE, String.class);
            method.invoke(null, httpServletRequest, httpServletResponse, loginDTO.getLogin(), loginDTO.getPassword(), false, CompanyConstants.AUTH_TYPE_SN);



But user is not logged in. There are no any errors in logs. What may be the problem???
It's strange, but there are no Response Cookies in response (they are available, when I log in through default login portlet).
Does anybody have a solution how to log in user programmatically in Liferay 6.2 ?


Regards, Vetal
Given Nyauyanga, modificado hace 9 años.

RE: Liferay 6.2 custom login portlet

New Member Mensajes: 2 Fecha de incorporación: 4/08/14 Mensajes recientes
This worked for me on Liferay 6.2 emoticon : LoginUtil Example class
thumbnail
Meera Prince, modificado hace 9 años.

RE: Liferay 6.2 custom login portlet

Liferay Legend Mensajes: 1111 Fecha de incorporación: 8/02/11 Mensajes recientes
Hi
find the sample sigin in plugin portlet in the following location download and deply.
Based on your

https://github.com/liferay/liferay-plugins/tree/6.2.x/portlets/sample-sign-in-portlet

Regards,
Meera Prince
thumbnail
Olaf Kock, modificado hace 9 años.

RE: Liferay 6.2 custom login portlet

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
I'm curious to learn why everybody seems to need their own custom login portlet. Please help me understand.

IMHO when you go the portal way - aren't you happy that all the infrastructure has been taken care of? You can finally just start to worry about your business logic and be sure that everything else (e.g. authentication etc.) has been taken care of...
Rafael Rodrigues, modificado hace 9 años.

RE: Liferay 6.2 custom login portlet

New Member Mensajes: 3 Fecha de incorporación: 21/08/14 Mensajes recientes
Olaf Kock:
I'm curious to learn why everybody seems to need their own custom login portlet. Please help me understand.

IMHO when you go the portal way - aren't you happy that all the infrastructure has been taken care of? You can finally just start to worry about your business logic and be sure that everything else (e.g. authentication etc.) has been taken care of...



Olaf Kock, I would like to do to just that! I already have the LDAP part fuctioning, but still need to integrate the login page in my web app, and costumize the layout of the page. Could you help me with thid?!

Thanks, Rafael
thumbnail
Olaf Kock, modificado hace 9 años.

RE: Liferay 6.2 custom login portlet

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
Customize the look&feel? There's CSS for that (unless the description "customize" is too broad).

What do you need to change in login that the standard login can't do for you - e.g. identify people and validate their identity.

My question is for those that completely write their own login, e.g. validate the password etc.

If you want to do the same: Use SSO. And if you can't find a supported SSO server that does what you want: Implement your own.
thumbnail
John Voltaire Maximo, modificado hace 8 años.

RE: Liferay 6.2 custom login portlet

Regular Member Mensajes: 106 Fecha de incorporación: 19/06/15 Mensajes recientes
Olaf Kock:
Customize the look&feel? There's CSS for that (unless the description "customize" is too broad).

I just want to remove some of the icons in the navigation below,, and put a link to forgot password placed beside 'remember me' checkbox
thumbnail
Himanshu Bhandari, modificado hace 8 años.

RE: Liferay 6.2 custom login portlet

Regular Member Mensajes: 148 Fecha de incorporación: 9/05/14 Mensajes recientes
Hi
I just want to remove some of the icons in the navigation below,, and put a link to forgot password placed beside 'remember me' checkbox

For this much of change Hook is enough.
Thanks.
Richard Fincher, modificado hace 9 años.

RE: Liferay 6.2 custom login portlet

New Member Mensajes: 3 Fecha de incorporación: 7/03/14 Mensajes recientes
Hi Olaf,

The standard LifeRay 6.2 login portlet is broken. If a user gets directed to a page and their session has timed out, they get redirected to the login page.

That works great if the user makes no typos when they login. They login and get sent to the page they originally were directed to.

However, if they don't enter the correct username/password they get directed to the error page where they can try to login again. When they successfully login they don't get sent to the page they were directed to, they get sent to their default page.

This is very confusing for the users.


Rick
thumbnail
Olaf Kock, modificado hace 9 años.

RE: Liferay 6.2 custom login portlet

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
well, if it's indeed broken, this is a different issue. Do you know a ticket for this to reproduce and get a chance to fix it?

My question above was more directed towards those that make the impression that the first thing they do on a portal is re-implement the login. And I stand by it: It should only be necessary in rare circumstances - and definitely not as the first operation to ever do on a portal environment.

Repairing a broken feature does not typically justify implementing a separate (custom) login. It justifies repairing the broken behaviour. Through code fixes, bug reports, or other means. The value of a platform like Liferay is that you have so much functionality that you just don't need to maintain yourself.
Richard Fincher, modificado hace 9 años.

RE: Liferay 6.2 custom login portlet

New Member Mensajes: 3 Fecha de incorporación: 7/03/14 Mensajes recientes
I don't know of any tickets and I don't know how to create one. I have to get this working and don't have time to wait for the next release and hope they fix it.

You can easily reproduce it. Browse to any page other than the default https://<your domain>/group/<your group>/<some page other than default>

You will be redirected to the login page. Login normally and you will go to <some page other than default>.

Logout and try it again, but this time intentionally enter the wrong password. You will end up at the error page. Login again with the correct password and you should be redirected to <some page other than default> but instead you will go to your default page.


Rick