无法使用LDAP验证sonarqube

时间:2017-05-07 21:41:20

标签: jenkins continuous-integration sonarqube sonar-runner

我使用LDAP 2.0插件配置了sonarqube 5.6。问题是用户无法使用LDAP凭据连接sonarqube。但不幸的是,有时它会在日志中抛出此错误后连接 Error from external users provider: exception Java::OrgSonarApiUtils::SonarException: Unable to retrieve details for user XXXX in <default> 2017.05.04 11:39:26 ERROR web[rails] Error from external groups provider: Unable to retrieve groups for user XXXX in <default>抛出此错误后,LDAP工作正常。但是当我从头开始再次安装sonarqube时,它会禁止用户登录,直到我收到同样的错误。

这是我的LDAP配置

sonar.security.realm=LDAP
ldap.url=ldap://ldap-google.com
ldap.bindDn=CN=x12345,OU=Corp,OU=GOOGLE,OU=Admin Accounts,DC=ggle,DC=com
ldap.bindPassword=password

# User Configuration    
ldap.user.baseDn=DC=ggle,DC=com
ldap.user.request=(&(objectClass=user)(sAMAccountName={login}))
ldap.user.realNameAttribute=cn
ldap.user.emailAttribute=mail

# Group Configuration
ldap.group.baseDn=CN=x12345,OU=corpoxxxx,DC=ggle,DC=com
ldap.group.request=(&(objectClass=group)(member={dn}))
ldap.group.idAttribute=sAMAccountName

当我尝试跟踪日志文件时,我得到了一些输入

DEBUG web[o.s.p.l.LdapUsersProvider] null
javax.naming.PartialResultException: null
at com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMoreImpl(AbstractLdapNamingEnumeration.java:237) ~[na:1.8.0_101]
at com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMore(AbstractLdapNamingEnumeration.java:189) ~[na:1.8.0_101]
at org.sonar.plugins.ldap.LdapSearch.findUnique(LdapSearch.java:146) ~[na:na]  

以及

Caused by: javax.naming.CommunicationException:DomainDnsZones.ggle.com:389
at com.sun.jndi.ldap.LdapReferralContext.<init>(LdapReferralContext.java:95) ~[na:1.8.0_101] at com.sun.jndi.ldap.LdapReferralException.getReferralContext(LdapReferralException.java:150) ~[na:1.8.0_101] at com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMoreReferrals(AbstractLdapNamingEnumeration.java:325) ~[na:1.8.0_101] at com.sun.jndi.ldap.AbstractLdapNamingEnumeration.hasMoreImpl(AbstractLdapNamingEnumeration.java:227) ~[na:1.8.0_101]
    ... 399 common frames omitted
Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_101]
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_101]
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_101]
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_101]
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_101]
    at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_101]
    at java.net.Socket.connect(Socket.java:538) ~[na:1.8.0_101]
    at java.net.Socket.<init>(Socket.java:434) ~[na:1.8.0_101]

0 个答案:

没有答案