我拼命想在這裏重現例如我的Liferay的Tomcat軟件包: http://liferay-blogging.blogspot.be/2011/08/how-to-change-liferay-login-module.html如何覆蓋Liferay的認證
我已經重新筆者的包和類:
package de.test.auth;
import java.util.Map;
import com.liferay.portal.security.auth.AuthException;
import com.liferay.portal.security.auth.Authenticator;
public class RefuseAuthenticator implements Authenticator {
public int authenticateByEmailAddress(long arg0, String arg1, String arg2, Map<String, String[]> arg3, Map<String, String[]> arg4) throws AuthException {
System.out.println("failed by mail");
return FAILURE;
}
public int authenticateByScreenName(long arg0, String arg1, String arg2, Map<String, String[]> arg3, Map<String, String[]> arg4) throws AuthException {
System.out.println("failed by screen name");
return FAILURE;
}
public int authenticateByUserId(long arg0, long arg1, String arg2, Map<String, String[]> arg3, Map<String, String[]> arg4) throws AuthException {
System.out.println("failed by user id");
return FAILURE;
}
}
我導出包作爲我放置在LR-門戶/ TOMCAT/LIB/ext文件夾
jar文件我添加了2行:
auth.pipeline.enable.liferay.check=false
auth.pipeline.pre=de.test.auth.RefuseAuthenticator
位於位於LR-portal/TOMCAT/webapps/ROOT/WEB-INF/lib/portlet_impl.jar中的標準portal.properties文件中。 我知道它應該在一個portal-ext.properties文件中,但它沒有奏效,所以我消除了所有可能的副作用。
不幸的是,Liferay會不斷記錄我的用戶。 我讀過關於在Liferay中執行自定義代碼的鉤子和ext方法,所以我可能會丟失一些東西。在寫這裏之前,我閱讀了許多論壇帖子。
我正在使用liferay-ce-portal-7.0-ga3 tomcat包。
謝謝。
正如博客文章所示,嘗試使用ext for this,並且在調試模式下使用sserver來驗證在認證過程中到相應類的流 –