如何让Liferay Authverifer工作
我正在实现Liferay 6.2 AuthVerifier。我开发了它,但没有调用它,即TestAuthVerifier.verify()方法 我引用了链接来开发est Authverier。下面是我所做的 我在portal-ext.properties文件中输入如下内容,并进一步开发该类如何让Liferay Authverifer工作,liferay,liferay-6,Liferay,Liferay 6,我正在实现Liferay 6.2 AuthVerifier。我开发了它,但没有调用它,即TestAuthVerifier.verify()方法 我引用了链接来开发est Authverier。下面是我所做的 我在portal-ext.properties文件中输入如下内容,并进一步开发该类 auth.verifier.pipeline=com.test.TestAuthVerifier auth.verifier.TestAuthVerifier.version.supported=1.0 我
auth.verifier.pipeline=com.test.TestAuthVerifier
auth.verifier.TestAuthVerifier.version.supported=1.0
我的代码如下,仅供参考
package comt.test;
import com.liferay.portal.security.auth.*;
public class TestAuthVerifier implements AuthVerifier {
@Override
public String getAuthType() {
return PhAuthVerifier.class.getSimpleName();
}
@Override
public AuthVerifierResult verify(
AccessControlContext accessControlContext, Properties properties)
throws AuthException {
System.out.println("MyAuthVerifier.verify() invoked..")
try {
.....
return authVerifierResult;
} catch (AutoLoginException e) {
throw new AuthException(e);
}
}
从Liferay 6.2.3源代码调试时,我看到了
注意:我已验证LifeRay是否识别我的TestAuthVerifier impl。要使其工作,您必须使用挂钩插件。首先在
WEB-INF
文件夹中创建一个文件liferay hook.xml
,以覆盖portal.properties
<?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">
<hook>
<portal-properties>portal.properties</portal-properties>
</hook>
这是liferay git中一个示例的链接,以了解更多详细信息我认为您必须将属性覆盖门户。属性放在钩子中,并将类放在同一个项目中。请您稍微详细解释一下,然后放在回答部分
auth.verifier.pipeline=com.test.TestAuthVerifier
auth.verifier.TestAuthVerifier.version.supported=1.0