How do I configure LDAP for Sonarqube Server?

1,627 views
Skip to first unread message

prateek...@gmail.com

unread,
Oct 10, 2017, 11:04:54 AM10/10/17
to SonarQube

I am trying to set the correct values for LDAP properties of a SonarQube Server (5.6.6 LTS). I am having difficulty finding a resource that explains the list of possible values for these properties, and understand which one to use in which scenario? I am referring to https://docs.sonarqube.org/display/PLUG/LDAP+Plugin For example,

Property1: ldap.user.request    
Default_Value: (&(objectClass=inetOrgPerson)(uid={login}))
Example for AD: (&(objectClass=user)(sAMAccountName={login}))

Here what are all the possible values for objectClass? When do i use value inetOrgPerson? When do I use value user? When do I use uid? When do I use sAMAccountName? What does it mean?

There are several other properties like memberAttribute , idAttribute which I dont understand.

Is there a guide available which describes ALL ldap properties and ALL their possible values? I tried searching on LDAP.com, openldap.org but couldnt find relevant answers.

sg.v...@gmail.com

unread,
Oct 11, 2017, 2:52:36 AM10/11/17
to SonarQube
Hi,
I had difficulties to configure LDAP with Active Directory server.
In the documentation you refer, take care about d the examples. That was the reason of my diffculties. In tables,  examples are for Active Directory server, default value are not compatible with  Active  Directory like the full configuration examples at the bottom of the doc.

Following, this is the configuration I did for Active Directory server:
# LDAP configuration
# General Configuration

sonar
.security.realm=LDAP
ldap
.url=ldap://<put your ldap server name>
ldap
.bindDn=<copy from your LDAP server the ldap bindDN string>
ldap
.bindPassword=<myUserPassword>

# User Configuratio

ldap
.user.baseDn=<copy from your LDAP server the user bindDN string>
ldap
.user.request=(&(objectClass=user)(sAMAccountName={login}))
ldap
.user.realNameAttribute=cn
ldap
.user.emailAttribute=mail


above config, with ldap server west.company.com and user guest with password gu3st, will be:
# LDAP configuration
# General Configuration

sonar
.security.realm=LDAP
ldap
.url=ldap://west.company.com
ldap
.bindDn=CN=guest,OU=Misc,OU=WESTAREA,OU=40-User Accounts,DC=west,DC=company,DC=com
ldap
.bindPassword=gu3st

# User Configuration

ldap
.user.baseDn=OU=Individual,OU=WESTAREA,OU=40-User Accounts,DC=west,DC=company,DC=com
ldap
.user.request=(&(objectClass=user)(sAMAccountName={login}))
ldap
.user.realNameAttribute=cn
ldap
.user.emailAttribute=mail

My issue was about the syntax of ldap.user.request.

I hope will help you. In my case, LDAP admin answer to my questions about ldap attributes.
Reply all
Reply to author
Forward
0 new messages