我正在努力为 Active Directory 配置 LDAP 2.0 plugin for Sonarqube 5.6.3 LTS。我阅读了所有插件文档,并为我们的环境找到了这个:
# LDAP configuration
# General Configuration
sonar.security.realm=LDAP
sonar.security.savePassword=false
sonar.forceAuthentication=true
ldap.url=ldap://ad1.prod:1389
ldap.bindDn=CN=myUser,OU=Service-Accounts,DC=ad1,DC=prod
ldap.bindPassword=myPassword
# User Configuration
ldap.user.baseDn=DC=ad1,DC=prod
ldap.user.request=(&(objectClass=inetOrgPerson)(uid={login}))
ldap.user.realNameAttribute=displayName
ldap.user.emailAttribute=mail
当我启动 Sonarqube 时,我得到:
INFO web[org.sonar.INFO] Security realm: LDAP
INFO web[o.s.p.l.LdapSettingsManager] User mapping: LdapUserMapping{baseDn=DC=ad1,DC=prod, request=(&(objectClass=inetOrgPerson)(uid={0})), realNameAttribute=displayName, emailAttribute=mail}
INFO web[o.s.p.l.LdapSettingsManager] Groups will not be synchronized, because property 'ldap.group.baseDn' is empty.
INFO web[o.s.p.l.LdapContextFactory] Test LDAP connection: FAIL
ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
java.lang.IllegalStateException: Unable to open LDAP connection
at org.sonar.plugins.ldap.LdapContextFactory.testConnection
我试过稍微调整配置,但没有运气。对于更熟悉这一点的人来说,有什么突出之处吗?
最佳答案
更有效的 AD 搜索类似于:
ldap.user.request=(&(objectClass=user)(sAMAccountName={login}))
关于active-directory - 如何使用 LDAP 2.0 插件为 SonarQube 5.6.3 配置 Active Directory?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40139543/