留言板
Overriding Liferay Login authentication
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.
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,修改在12 年前。
RE: Overriding Liferay Login authentication
Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子and have setup following properties in portal.properties file
Instead of portal.properties file, create a portal-ext.properties file.
Hir O,修改在12 年前。
RE: Overriding Liferay Login authentication
Junior Member 帖子: 30 加入日期: 12-3-14 最近的帖子
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
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
Amos Fong,修改在12 年前。
RE: Overriding Liferay Login authentication
Liferay Legend 帖子: 2047 加入日期: 08-10-7 最近的帖子
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.
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,修改在12 年前。
RE: Overriding Liferay Login authentication
Expert 帖子: 427 加入日期: 09-8-12 最近的帖子
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
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,修改在12 年前。
RE: Overriding Liferay Login authentication
Junior Member 帖子: 30 加入日期: 12-3-14 最近的帖子
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
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,修改在12 年前。
RE: Overriding Liferay Login authentication
Expert 帖子: 427 加入日期: 09-8-12 最近的帖子
Try this ......
If you have ActionRequest object actionReq
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(actionReq);
Thanks,
Anil Sunkari
If you have ActionRequest object actionReq
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(actionReq);
Thanks,
Anil Sunkari
Hir O,修改在12 年前。
RE: Overriding Liferay Login authentication
Junior Member 帖子: 30 加入日期: 12-3-14 最近的帖子
I don't have it directly.
Can I get it through any Util class like PortalUtil or any??
Can I get it through any Util class like PortalUtil or any??
Anil Sunkari,修改在12 年前。
RE: Overriding Liferay Login authentication
Expert 帖子: 427 加入日期: 09-8-12 最近的帖子
Hir O,修改在12 年前。
RE: Overriding Liferay Login authentication
Junior Member 帖子: 30 加入日期: 12-3-14 最近的帖子
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
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,修改在12 年前。
RE: Overriding Liferay Login authentication
Expert 帖子: 427 加入日期: 09-8-12 最近的帖子
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
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
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.
Harsh Kanakhara,修改在7 年前。
RE: Overriding Liferay Login authentication
New Member 帖子: 14 加入日期: 16-1-29 最近的帖子
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 ?
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 ?