Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hir O
Overriding Liferay Login authentication
March 15, 2012 8:44 PM
Answer

Hir O

Rank: Junior Member

Posts: 30

Join Date: March 14, 2012

Recent Posts

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.
Hitoshi Ozawa
RE: Overriding Liferay Login authentication
March 15, 2012 8:46 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

and have setup following properties in portal.properties file


Instead of portal.properties file, create a portal-ext.properties file.
Hir O
RE: Overriding Liferay Login authentication
March 15, 2012 9:24 PM
Answer

Hir O

Rank: Junior Member

Posts: 30

Join Date: March 14, 2012

Recent Posts

Hi Hitoshi,

Thanks for replying.

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

<hook>
<portal-properties>portal.properties</portal-properties>
</hook>


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
Amos Fong
RE: Overriding Liferay Login authentication
March 15, 2012 9:53 PM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1844

Join Date: October 7, 2008

Recent Posts

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.
Anil Sunkari
RE: Overriding Liferay Login authentication
March 16, 2012 12:19 AM
Answer

Anil Sunkari

Rank: Expert

Posts: 384

Join Date: August 11, 2009

Recent Posts

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
Hir O
RE: Overriding Liferay Login authentication
March 16, 2012 5:45 AM
Answer

Hir O

Rank: Junior Member

Posts: 30

Join Date: March 14, 2012

Recent Posts

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
Anil Sunkari
RE: Overriding Liferay Login authentication
March 16, 2012 5:57 AM
Answer

Anil Sunkari

Rank: Expert

Posts: 384

Join Date: August 11, 2009

Recent Posts

Try this ......

If you have ActionRequest object actionReq

HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(actionReq);

Thanks,
Anil Sunkari
Hir O
RE: Overriding Liferay Login authentication
March 16, 2012 6:13 AM
Answer

Hir O

Rank: Junior Member

Posts: 30

Join Date: March 14, 2012

Recent Posts

I don't have it directly.

Can I get it through any Util class like PortalUtil or any??
Anil Sunkari
RE: Overriding Liferay Login authentication
March 16, 2012 6:23 AM
Answer

Anil Sunkari

Rank: Expert

Posts: 384

Join Date: August 11, 2009

Recent Posts

Hir O
RE: Overriding Liferay Login authentication
March 18, 2012 8:43 PM
Answer

Hir O

Rank: Junior Member

Posts: 30

Join Date: March 14, 2012

Recent Posts

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
Anil Sunkari
RE: Overriding Liferay Login authentication
March 19, 2012 10:48 PM
Answer

Anil Sunkari

Rank: Expert

Posts: 384

Join Date: August 11, 2009

Recent Posts

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
Ash K
RE: Overriding Liferay Login authentication
March 22, 2012 8:17 AM
Answer

Ash K

Rank: New Member

Posts: 4

Join Date: February 13, 2012

Recent Posts

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 Marin
RE: Overriding Liferay Login authentication
November 12, 2013 12:07 PM
Answer

Greg Marin

Rank: New Member

Posts: 1

Join Date: November 12, 2013

Recent Posts

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