【问题标题】:Configure authentication and synchronization with two LDAP in Alfresco 5.1在 Alfresco 5.1 中使用两个 LDAP 配置身份验证和同步
【发布时间】:2023-03-06 17:07:01
【问题描述】:

我们执行从企业版 Alfresco 4.2 到 5.1 的迁移。 公司中有两个 Active Directory 域(主域和子域),因此我们在 Alfresco 5.1 中配置了两个 LDAP(AD) 子系统。

属性结构: /opt/tomcat7/shared/classes/alfresco/extension/subsystems/Authentication/ldap-ad/ldap2 /opt/tomcat7/shared/classes/alfresco/extension/subsystems/Authentication/ldap-ad/ldap1

问题是身份验证和同步仅适用于一个 ldap-ad 子系统(ldap1 或 ldap2),它们在身份验证链列表中排名第一(ldap1 和 ldap2 不能一起工作)。

Authentication chain screenshot

例如,如果 ldap1 在列表中排名第一,则该用户从 ldap2 登录失败(反之亦然!)。 在这种情况下,我在 alfresco.log 中查看错误:

Caused by: net.sf.acegisecurity.AuthenticationCredentialsNotFoundException: A valid SecureContext was not provided in the RequestContext 

我的属性:

/opt/tomcat7/shared/classes/alfresco/extension/subsystems/Authentication/ldap-ad/ldap1/ldap-ad-authentication.properties

ldap.authentication.active=true
ldap.authentication.allowGuestLogin=false
ldap.authentication.userNameFormat=%s@fake.local
ldap.authentication.java.naming.provider.url=ldap://fake.local:***
ldap.authentication.defaultAdministratorUserNames=fake_user
ldap.authentication.java.naming.referral=follow

ldap.synchronization.java.naming.security.principal=fake_user@fake.local
ldap.synchronization.java.naming.security.credentials=somepassword
ldap.synchronization.groupSearchBase=ou=Archiv,ou=FileServerGroups,ou=Groups,dc=fake,dc=local
ldap.synchronization.userSearchBase=dc=fake,dc=local
ldap.synchronization.groupDisplayNameAttributeName=description
ldap.synchronization.userOrganizationalIdAttributeNameCustom=distinguishedName
ldap.synchronization.com.sun.jndi.ldap.connect.pool=true

/opt/tomcat7/shared/classes/alfresco/extension/subsystems/Authentication/ldap-ad/ldap2/ldap-ad-authentication.properties

ldap.authentication.active=true
ldap.authentication.allowGuestLogin=false
ldap.authentication.userNameFormat=%s@gss.fake.local
ldap.authentication.java.naming.provider.url=ldap://gss.fake.local:***
ldap.authentication.defaultAdministratorUserNames=fake_user
ldap.authentication.java.naming.referral=follow

ldap.synchronization.java.naming.security.principal=fake_user@fake.local
ldap.synchronization.java.naming.security.credentials=somepassword%
ldap.synchronization.groupSearchBase=ou=Archiv,ou=FileServerGroups,ou=Groups,dc=gss,dc=fake,dc=local
ldap.synchronization.userSearchBase=dc=gss,dc=fake,dc=local
ldap.synchronization.groupDisplayNameAttributeName=description
ldap.synchronization.userOrganizationalIdAttributeNameCustom=distinguishedName
ldap.synchronization.com.sun.jndi.ldap.connect.pool=true

alfresco-global.properties

### Authentication ###
#authentication.chain=ldap1:ldap-ad,ldap2:ldap-ad,alfrescoNtlm1:alfrescoNtlm
authentication.chain=alfinst:alfrescoNtlm,ldap1:ldap-ad,ldap2:ldap-ad

提前致谢!

【问题讨论】:

  • 您是否尝试过编辑 WEB-INF/classes/log4j.properties 以打开一些与身份验证相关的记录器?也许日志中的一些额外细节有助于阐明这个问题。
  • 是的,我们打开了一些调试选项并在 alfresco.log 中观察到错误:DEBUG org.alfresco.repo.security.authentication.ldap.LDAPAuthenticationComponentImpl] [http-bio-8080-exec- 13] 验证用户“test_user”错误 [org.springframework.extensions.webscripts.AbstractRuntime] [http-bio-8080-exec-13] 来自 executeScript 的异常:09160047 Wrapped Exception(带有状态模板):未提供有效的 SecureContext RequestContext ... 引起:net.sf.acegisecurity.AuthenticationCredentialsNotFoundException:RequestContext 中未提供有效的 SecureContext

标签: alfresco alfresco-enterprise


【解决方案1】:

最后,我解决了与身份验证用户相关的问题。 我放了一个空的参数字符串:

ldap.authentication.userNameFormat=

对于文件 ldap-ad-authentication.properties 中的每个 LDAP 子系统。

之后,两个ldaps的用户都可以登录成功了。

ldap.authentication.userNameFormat

指定如何将用户输入的用户标识符映射到 传递给 LDAP。如果设置为空字符串(默认为 ldap 子系统),一个 LDAP 查询涉及 ldap.synchronization.personQuery 和 会执行 ldap.synchronization.userIdAttributeName 来解析 来自用户 ID 的 DN 动态。这允许目录 结构化并且不需要用户 ID 出现在 DN 中。

如果设置为非空值,则该值中的子字符串 %s 将是 替换为输入的用户 ID 以生成传递给 LDAP 的 ID。 这会将 LDAP 用户名限制为固定格式。推荐的 此值的格式取决于您的 LDAP 服务器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-28
    • 2016-09-12
    • 2016-03-15
    • 2020-09-19
    • 2017-02-01
    • 2016-02-26
    • 1970-01-01
    相关资源
    最近更新 更多