目前,从SonarQube 5.0.1连接到Apache Directory Server 2.0 . 在sonar.properties文件中给出了以下条目:
# LDAP configuration
# General Configuration
sonar.security.realm=LDAP
sonar.security.savePassword=false
ldap.url=ldap://10.53.67.11:30389
# User Configuration
ldap.user.baseDn=o=TechMahindra
ldap.user.request=(&(objectClass=inetOrgPerson)(uid={login}))
ldap.user.realNameAttribute=cn
ldap.user.emailAttribute=mail
# Group Configuration
ldap.group.baseDn=cn=sonar-users,ou=groups,ou=devops,o=TechMahindra
ldap.group.request=(&(objectClass=groupOfNames)(member={dn}))
ldap.group.idAttribute=cn
使用这些条目,身份验证不适用于任何用户 .
注意1:在Apache Directory Server中选中“启用访问控制”选项 .
注2: However, if the above mentioned "Enable Access Control" option is not checked in the Apache Directory Server, authentication works. 并且,授权在这种情况下不起作用 - 即 - 无论用户是否属于LDAP中的声纳用户组,所有用户都可以登录SonarQube .
1 回答
"Enable Access Control"用于授权访问LDAP目录信息树(而不是用于授权应用程序) . 我后来发现了这个 .
对于应用程序级别授权,使用memberOf或isMemberOf等属性 .
Apache Directory Server在编写此内容时不支持memberOf或isMemberOf属性 .
因此,我将OpenLDAP用于此目的,并通过将其添加到slapd.conf文件中来使用memberOf属性(覆盖,换句话说) .