Foros de discusión

Overriding Liferay Login authentication

thumbnail
Hir O, modificado hace 12 años.

Overriding Liferay Login authentication

Junior Member Mensajes: 30 Fecha de incorporación: 14/03/12 Mensajes recientes
Hi All,

I am using Liferay 6.0.6, and I want to override default Liferay Login authentication and want to set up my custom authentication.

Till now what I have done is, I have created a hook-plugin and have setup following properties in portal.properties file

auth.pipeline.pre=com.liferay.portal.security.auth.MyCustomAuthenticator
auth.pipeline.enable.liferay.check=false


where MyCustomAuthenticator is my custom authenticator class ( which implements Authenticator).

Currently, Liferay checks this custom authentication 1st, but then again it goes to Liferay itself for further Liferay authentication too.

I want to override this Liferay validation. Please help me solve this issue.
thumbnail
Hitoshi Ozawa, modificado hace 12 años.

RE: Overriding Liferay Login authentication

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
and have setup following properties in portal.properties file


Instead of portal.properties file, create a portal-ext.properties file.
thumbnail
Hir O, modificado hace 12 años.

RE: Overriding Liferay Login authentication

Junior Member Mensajes: 30 Fecha de incorporación: 14/03/12 Mensajes recientes
Hi Hitoshi,

Thanks for replying.

I have mapped portal.properties file in liferay-hook.xml as follows.

[indent]<hook>
<portal-properties>portal.properties</portal-properties>
</hook>
[/indent]

You want me to change this by new portal-ext.properties file or want me to change in the liferay's portal-ext.properties file??

Thanks for replying again
thumbnail
Amos Fong, modificado hace 12 años.

RE: Overriding Liferay Login authentication

Liferay Legend Mensajes: 2047 Fecha de incorporación: 7/10/08 Mensajes recientes
Hi,

According to the liferay hook DTD, http://www.liferay.com/dtd/liferay-hook_6_1_0.dtd, auth.pipeline.enable.liferay.check is not a property you can override in a hook.

You can do what Hitoshi suggests and change portal-ext.properties for your liferay portal.
thumbnail
Anil Sunkari, modificado hace 12 años.

RE: Overriding Liferay Login authentication

Expert Mensajes: 427 Fecha de incorporación: 12/08/09 Mensajes recientes
Hi Hirav,

Please check with what Hithosi suggested you & i'm also wondering can we make change of props files as -ext.prop.If it works then you issue will also be resolved.If not let me know i have some other idea but will think on more compatibility.

Thanks,
Anil Sunkari
thumbnail
Hir O, modificado hace 12 años.

RE: Overriding Liferay Login authentication

Junior Member Mensajes: 30 Fecha de incorporación: 14/03/12 Mensajes recientes
Hi All

Thank you all, I have solved the issue.

I just want 1 more thing. Can I have HttpServletRequest object there at Authenticator class??

Thanks again for replying
thumbnail
Anil Sunkari, modificado hace 12 años.

RE: Overriding Liferay Login authentication

Expert Mensajes: 427 Fecha de incorporación: 12/08/09 Mensajes recientes
Try this ......

If you have ActionRequest object actionReq

HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(actionReq);

Thanks,
Anil Sunkari
thumbnail
Hir O, modificado hace 12 años.

RE: Overriding Liferay Login authentication

Junior Member Mensajes: 30 Fecha de incorporación: 14/03/12 Mensajes recientes
I don't have it directly.

Can I get it through any Util class like PortalUtil or any??
thumbnail
Anil Sunkari, modificado hace 12 años.

RE: Overriding Liferay Login authentication

Expert Mensajes: 427 Fecha de incorporación: 12/08/09 Mensajes recientes
thumbnail
Hir O, modificado hace 12 años.

RE: Overriding Liferay Login authentication

Junior Member Mensajes: 30 Fecha de incorporación: 14/03/12 Mensajes recientes
Hi All,

I actually want to set some values to my Browser Cookies after this authentication. Here I am authenticating user through openAM and so as I want to store the token to the cookies to get used by other applications on the same domain to use single sign on.

I don't know much about ThreadLocal, but I don't think it will help me with this.

Please help me solve this.

Thanks
thumbnail
Anil Sunkari, modificado hace 12 años.

RE: Overriding Liferay Login authentication

Expert Mensajes: 427 Fecha de incorporación: 12/08/09 Mensajes recientes
Try with this quick solution.... may be it might resolve your hope !! i believe

create a customattribute for user
In Authenication class you have map .So, you can call one method to store some information which u need to pass to other systems as a custom attribute for user
then after post login u can retrive this info from table and you have request in post login, finally store it in cookie or session to pass these values to other systems.

Meanwhile have a look at
UserLocalServiceImpl.java at 2628 line for authentication module once.


Regards,
Anil Sunkari
a b, modificado hace 12 años.

RE: Overriding Liferay Login authentication

New Member Mensajes: 4 Fecha de incorporación: 13/02/12 Mensajes recientes
Hir O:
Hi All

Thank you all, I have solved the issue.

I just want 1 more thing. Can I have HttpServletRequest object there at Authenticator class??

Thanks again for replying



How did you solve your issue? I will be great if you can mention the solution so others can benefit.
Thanks.
Greg M, modificado hace 10 años.

RE: Overriding Liferay Login authentication

New Member Mensajes: 5 Fecha de incorporación: 12/11/13 Mensajes recientes
Hi All,

I realize this is an old post, but could you detail the solution to override the second authentication done by liferay please?

Thanks
Harsh Kanakhara, modificado hace 7 años.

RE: Overriding Liferay Login authentication

New Member Mensajes: 14 Fecha de incorporación: 29/01/16 Mensajes recientes
In my login portlet I am including one extra field which used to store some url. During Sign-In I only want to pass that url. But in the authentication pipeline username or screen name is mandatory.

I want to write my custom business logic in the custom authenticator class which will fetch username based on url. How do I achieve it ?