嗨,我一直在努力让 Active Directory 与 SonarQube 5.6 LTS 一起工作
请在下面找到配置详细信息
sonar.security.realm = LDAP
sonar.authenticator.downcase=false
ldap.url=ldap://xxx.xxxxxx.com:3268
ldap.user.baseDn=cn=users,dc=xxxxxx,dc=com
ldap.user.request = (&(objectClass=user)(sAMAccountName={login}))
ldap.user.realNameAttribute=cn
ldap.user.emailAttribute=mail
ldap.group.baseDn=cn=groups,dc=xxxxxx,dc=com
ldap.group.request=(&(objectClass=group)(member={dn}))
ldap.group.idAttribute = sAMAccountName
ldap.realm = xxxxxx.com
ldap.authentication = simple
ldap.baseDn = dc=xxxxxx dc=com
ldap.bindDn = xxxxxx\\xxxxxx
ldap.bindPassword = xxxxxxx
我确实在 sonarqube 日志中看到了 Test LDAP Connection Ok
2017.01.16 19:00:30 DEBUG web[o.s.p.l.LdapContextFactory] Initializing LDAP context {java.naming.provider.url=ldap://xxx.xxxxxx.com:389,
java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory,
java.naming.security.principal=xxxxxx\xxxxxx,
com.sun.jndi.ldap.connect.pool=true,
java.naming.security.authentication=simple,
java.naming.security.sasl.realm=xxxxxx.com,
java.naming.referral=follow}
2017.01.16 19:00:30 INFO web[o.s.p.l.LdapContextFactory] Test LDAP connection on ldap://xxx.xxxxxx.com:389: OK
但是,当我尝试使用我的 LDAP 用户名和密码登录时,我无法登录。在日志中观察到以下消息
2017.01.16 16:44:28 DEBUG web[o.s.p.l.LdapUsersProvider] Requesting details for user xxxxxx\xxxxx
2017.01.16 16:44:28 DEBUG web[o.s.p.l.LdapSearch] Search: LdapSearch{baseDn=cn=users,dc=xxxxxx,dc=com, scope=subtree,
request=(&(objectClass=user)(sAMAccountName={0})),
parameters=[xxxxxx\xxxxxx], attributes=[mail, cn]}
2017.01.16 16:44:28 DEBUG web[o.s.p.l.LdapContextFactory] Initializing LDAP context {java.naming.provider.url=ldap://xxx.xxxxxx.com:389,
java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory,
java.naming.security.principal=xxxxxx\xxxxxx,
com.sun.jndi.ldap.connect.pool=true,
java.naming.security.authentication=simple,
java.naming.security.sasl.realm=xxxxxx.com,
java.naming.referral=follow}
2017.01.16 16:44:28 DEBUG web[o.s.p.l.LdapUsersProvider] User xxxxxx\xxxxxx not found in <default>
2017.01.16 16:44:28 DEBUG web[http] POST /sessions/login | time=69ms
2017.01.16 16:44:38 DEBUG web[o.s.p.l.LdapUsersProvider] Requesting details for user xxxxxx\xxxxxx
2017.01.16 16:44:38 DEBUG web[o.s.p.l.LdapSearch] Search: LdapSearch{baseDn=cn=users,dc=xxxxxx,dc=com, scope=subtree,
request=(&(objectClass=user)(sAMAccountName={0})),
parameters=[xxxxxx\xxxxxx], attributes=[mail, cn]}
2017.01.16 16:44:38 DEBUG web[o.s.p.l.LdapContextFactory] Initializing LDAP context {java.naming.provider.url=ldap://DC1.xxxxxx.com:389,
java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory,
java.naming.security.principal=xxxxxx\xxxxxx,
com.sun.jndi.ldap.connect.pool=true,
java.naming.security.authentication=simple,
java.naming.security.sasl.realm=xxxxxx.com,
java.naming.referral=follow}
2017.01.16 16:44:38 DEBUG web[o.s.p.l.LdapUsersProvider] User xxxxxx\xxxxxx not found in <default>
2017.01.16 16:44:38 DEBUG web[http] POST /sessions/login | time=55ms
到目前为止,我已经尝试了以下方法:
- 尝试使用端口:3268 / 389
- 从命令行尝试了 ldapsearch
ldapsearch -H ldap://xxx.xxxxx.com:3268 dc=xxxxx,dc=com -D 'xxxxxx\xxxxxx' -W
但这也返回空
我只有一个本地配置的管理员用户,我能够以管理员身份登录
当我在 Jenkins 上配置 Active Directory 时,相同的用户名和服务器详细信息运行良好
我哪里错了?我可以尝试哪些其他选择?