简体   繁体   English

Alfresco共享身份验证

[英]Alfresco share authentication

I need to modify the Share authentication mechanism. 我需要修改Share身份验证机制。 When a user attempts to login from the share page, I need to add a check that checks for the user's tenant domain with the prefix of the web address. 当用户尝试从共享页面登录时,我需要添加一个检查,检查用户的租户域和网址的前缀。 If username's tenant address matches with the prefix of the web address then the user is allowed to log in otherwise the authentication is rejected. 如果用户名的租户地址与网址的前缀匹配,则允许用户登录,否则拒绝认证。

For examples: 举些例子:

user logs in as username@mydomain.com from mydomain.alfresco.com/share 用户从mydomain.alfresco.com/share以username@mydomain.com身份登录

In the above case the user would be allowed to login because ...@mydomain.com matches with the web address prefix mydomain.alfresco.com/share. 在上述情况下,用户可以登录,因为... @ mydomain.com与网址前缀mydomain.alfresco.com/share匹配。

I am not sure where to begin and would appreciate any help on accomplishing this. 我不知道从哪里开始,并希望得到任何帮助来实现这一目标。

I would implement it overriding the loginController Spring bean. 我会实现它覆盖loginController Spring bean。 Make a copy of org.springframework.extensions.surf.mvc.LoginController.java and add your your custom logic to handleRequestInternal . 制作org.springframework.extensions.surf.mvc.LoginController.java的副本,并将您的自定义逻辑添加到handleRequestInternal request.getParameter("username") and request.getHeader("Host") should provide the values for the comparision. request.getParameter("username")request.getHeader("Host")应该提供比较的值。

One way to override the default implementation by placing the bean definition in a file alfresco/web-extension/custom-context.xml in the classpath. 通过将bean定义放在类路径中的文件alfresco/web-extension/custom-context.xml中来覆盖默认实现的一种方法。

<bean id="loginController" class="CustomLoginController">
    <property name="cacheSeconds" value="-1" />
    <property name="useExpiresHeader"><value>true</value></property>
    <property name="useCacheControlHeader"><value>true</value></property>
    <property name="userFactory" ref="user.factory"></property>
    <property name="connectorService" ref="connector.service" />
</bean>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM