如何在liferay 6.1中为LDAPAuth类创建钩子

如何在liferay 6.1中为LDAPAuth类创建钩子,ldap,hook,liferay-6,Ldap,Hook,Liferay 6,我试图在lliferay 6.1中钩住LDAPAuth类,以覆盖authenticateByEmailAddress,从而从我的角度添加一些逻辑。我不知道如何在liferay-hook.xml中定义它 <hook> <portal-properties>portal.properties</portal-properties> <custom-jsp-dir>/jsp_overrides</custom-jsp-dir> &

我试图在lliferay 6.1中钩住LDAPAuth类,以覆盖authenticateByEmailAddress,从而从我的角度添加一些逻辑。我不知道如何在liferay-hook.xml中定义它

<hook>
  <portal-properties>portal.properties</portal-properties>
  <custom-jsp-dir>/jsp_overrides</custom-jsp-dir>
  <service>
    <service-type>com. </service-type>
    <service-impl></service-impl>
  </service>
</hook>

portal.properties
/jsp_覆盖
通用域名格式。

服务类型和service-imp中应该提供什么。我的类名是MyLDAPAuth,它从liferay扩展了LDAPauth

我认为您不能创建一个钩子来覆盖这个类,因为这个类驻留在portal-impl.jar中,不能从插件portlet或钩子中引用(这是它的最佳选择,您也可以阅读这篇文章,了解为什么我们不能,为什么我们不应该在插件中使用portal-impl.jar)的更多信息

所以剩下的唯一选择就是EXT

此外,如果在EXT中创建自定义类,则需要在portal-EXT.properties with属性中指定它(请阅读portal.properties中此属性的注释):

我没有尝试过,但我认为在插件portlet或钩子中创建自定义类并更改此属性是不可能的

希望这能回答你的问题,或者至少能给你一个更进一步的想法

多谢各位

auth.pipeline.pre=com.custom.portal.security.auth.MyLDAPAuth