如何覆盖默认的Liferay登录身份验证? [英] How to override default Liferay Login authentication?
问题描述
我正在使用Liferay 6.1,并且我想覆盖默认的Liferay登录身份验证,并希望设置我的自定义身份验证.
I am using Liferay 6.1, and I want to override default Liferay Login authentication and want to set up my custom authentication.
到现在为止,我已经创建了一个钩子插件,并在portal.properties文件中设置了以下属性
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
其中MyCustomAuthenticator是我的自定义身份验证器类(实现Authenticator).
where MyCustomAuthenticator is my custom authenticator class ( which implements Authenticator).
当前,Liferay首先检查此自定义身份验证,但随后再次转到Liferay本身,以进行进一步的Liferay身份验证.
Currently, Liferay checks this custom authentication 1st, but then again it goes to Liferay itself for further Liferay authentication too.
我想覆盖此Liferay验证.请帮我解决这个问题. 这是我的身份验证器类:
I want to override this Liferay validation. Please help me solve this issue. Here is my authenticator class:
public class MyCustomAuthenticator implements Authenticator {
public int authenticateByEmailAddress(long arg0, String arg1, String arg2, Map<String, String[]> arg3, Map<String, String[]> arg4) throws AuthException {
System.out.println("succeeded by mail");
return SUCCESS;
}
public int authenticateByScreenName(long arg0, String arg1, String arg2, Map<String, String[]> arg3, Map<String, String[]> arg4) throws AuthException {
System.out.println("succeeded by screen name");
return SUCCESS;
}
public int authenticateByUserId(long arg0, long arg1, String arg2, Map<String, String[]> arg3, Map<String, String[]> arg4) throws AuthException {
System.out.println("succeeded by user id");
return SUCCESS;
}
}
推荐答案
在portal-ext.properties中添加以下属性,然后重新启动服务器
Add the following property in portal-ext.properties and then restart the server
auth.pipeline.enable.liferay.check=false
这篇关于如何覆盖默认的Liferay登录身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!