无法同步 TeamCity 中的用户组

无法同步 TeamCity 中的用户组

0 用户和组已同步 以下是我的 ldap 日志和设置。我想要做的就是: 1. 将 AD 组“ccusers”映射到 TeamCity 中的组,并在该组中创建所有用户。 2. 或者将 AD 组“ccusers”中的所有用户添加到 TeamCity 中的“所有用户”组。

我该如何设置呢?

[2014-02-10 09:11:01,871]   INFO -     jetbrains.buildServer.LDAP - Starting synchronization session
[2014-02-10 09:11:01,871]   INFO -     jetbrains.buildServer.LDAP - Fetching remote users and groups
[2014-02-10 09:11:01,902]   WARN -     jetbrains.buildServer.LDAP - Total results: 0
[2014-02-10 09:11:01,917]   INFO -     jetbrains.buildServer.LDAP - LDAP groups mapping loaded
[2014-02-10 09:11:01,964]   WARN -     jetbrains.buildServer.LDAP - Total results: 1
[2014-02-10 09:11:01,964]   INFO -     jetbrains.buildServer.LDAP - Last synchronization statistics: created users=0, updated users=0, deleted users=0, remote users=0, matched users=0, created groups=0, updated groups=0, deleted groups=0, remote groups=0, matched groups=0, duration=93ms, errors=[]

# LDAP SYNCHRONIZATION
####################################################################################################

### USERS SETTINGS ###

# Set to "true" to enable the synchronization for existig users' properties.
# For users creation and deletion, see teamcity.options.groups.synchronize and consider mapping "All Users" group
teamcity.options.users.synchronize=true

# The user search LDAP filter used to retrieve users to synchronize.
# The search is performed inside the LDAP entry denoted by "teamcity.users.base".
# Note: during the process of user authentication the "teamcity.users.login.filter" filter is used, not this one.
#teamcity.users.filter=(objectClass=user)
teamcity.users.filter=(&(objectCategory=Person)(memberof=CN=ccusers,OU=UNIX%20Security%20Groups,OU=CTD_CM_RMG,OU=Corporate%20Clients%20V2,DC=office,DC=adroot,DC=bmogc,DC=net))

### GROUPS SETTINGS ###
# These settings are mandatory if groups synchronization is turned on (ldap-mapping.xml exists)

# Set to "true" to enable the synchronization for groups listed in ldap-mapping.xml file.
# IMPORTANT NOTE: TeamCity groups should be alredy created manually and listed in ldap-mapping.xml file.
teamcity.options.groups.synchronize=true

# The groups base DN. If defined, groups are retrieved only from the LDAP subtree denoted by this DN.
# This DN should be "relative" to the root specified by "java.naming.provider.url".
# If omitted, it is assumed empty and group searches are performed under the entry denoted by "java.naming.provider.url".
#teamcity.groups.base=CN=users
#teamcity.groups.base=DC=office,DC=adroot,DC=bmogc,DC=net
# The group search LDAP filter used to retrieve groups to synchronize.
# The search is performed inside the LDAP entry denoted by "teamcity.groups.base".
#teamcity.groups.filter=(objectClass=group)
teamcity.groups.filter=(&(objectClass=Group)(|(cn=ccusers)))

# Set to "true" to enable automatic user creation and deletion during group synchronization.
teamcity.options.createUsers=false
teamcity.options.deleteUsers=false

### OPTIONAL SETTINGS ###

# The time interval between synchronizations (in milliseconds). By default, it is one hour.
teamcity.options.syncTimeout = 3600000

# The attribute that indicates the member of the group.
# Note: LDAP property should contain the full DN of the member.
teamcity.groups.property.member=member

# The name of LDAP attribute containing the DN. By default, 'distinguishedName' is used.
#teamcity.property.distinguishedName=distinguishedName
teamcity.property.distinguishedName=cn

# The name of LDAP attribute to retrieve user's full name
teamcity.users.property.displayName=displayName

# The name of LDAP attribute to retrieve user's email
teamcity.users.property.email=mail

答案1

如果我理解正确的话,您应该编辑 ldap-mapping.xml(或者从 ldap-mapping.xml.dist 创建副本)。您可以在此文件中创建映射。

<!DOCTYPE mapping SYSTEM "ldap-mapping.dtd">
<mapping>  
  <group-mapping teamcityGroupKey="ALL_USERS_GROUP" ldapGroupDn="CN=ccusers,OU=UNIX%20Security%20Groups,OU=CTD_CM_RMG,OU=Corporate%20Clients%20V2,DC=office,DC=adroot,DC=bmogc,DC=net"/>     
</mapping>

更新:

我比较了您的日志和我的日志。我看到“统计信息:... 远程用户=27,... 远程组=1”。所以我猜您的过滤器或基础可能有错误。我在 LDAP Apanche Directory Studio 中调试了我的过滤器。

相关内容