Sonar-LDAP configuration :User authentication failed

3,709 views
Skip to first unread message

Sarojini Meher

unread,
Jun 23, 2016, 2:03:42 AM6/23/16
to SonarQube
Hi, 
i am trying to configure LDAP with sonar.

here is my configuration..

#LDAP configuration 
# General Configuration

sonar.security.realm=LDAP
sonar.security.savePassword=false
sonar.security.updateUserAttributes=true
sonar.authenticator.createUsers=true
sonar.authenticator.downcase=false
ldap.url=ldap://ad.example.com:389
#ldap.windows.auth=false
ldap.contextFactoryClass=com.sun.jndi.ldap.LdapCtxFactory
ldap.authentication=simple
#ldap.bindDn=
#ldap.bindPassword=



# User Configuration

ldap.user.baseDn=OU=Users,OU=KEC,OU=BLR,OU=IND,DC=ad,DC=company,DC=com

ldap.user.request=(&(objectClass=user)(sAMAccountName={login}))

ldap.user.realNameAttribute=cn
ldap.user.emailAttribute=mail

# Group Configuration
#ldap.group.baseDn=ou=Groups,dc=sonarsource,dc=com
#ldap.group.request=(&(objectClass=posixGroup)(memberUid={uid}))


And I have attached the log files..It is saying connection ok

2016.06.23 11:05:08 INFO  web[o.s.p.l.LdapContextFactory] Test LDAP connection on ldap://192.168.200.55: OK


But while trying to login into sonar..it is giving me error like this.
it is not even giving any error in log files.
i m using sonarqube 5.6
and sonar-ldap-plugin-2.0.jar

Please help..

Thanks in advance..


sonar.log
access.log

Julien Lancelot

unread,
Jun 23, 2016, 8:09:31 AM6/23/16
to Sarojini Meher, SonarQube
Hi,

From what I can see in the log, SonarQube fails to authenticate the user : 

2016.06.23 11:07:46 ERROR web[rails] Error from external users provider: exception Java::OrgSonarApiUtils::SonarException: Unable to retrieve details for user itlinfosys\sarojini_meher in <default>

And the detail of error is displayed before : 

2016.06.23 11:07:46 DEBUG web[o.s.p.l.LdapUsersProvider] [LDAP: error code 1 - 000004DC: LdapErr: DSID-0C0906E8, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db1 ]
javax.naming.NamingException: [LDAP: error code 1 - 000004DC: LdapErr: DSID-0C0906E8, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db1 ]
	at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source) ~[na:1.8.0_92]
	at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source) ~[na:1.8.0_92]
	at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source) ~[na:1.8.0_92]
	at com.sun.jndi.ldap.LdapCtx.searchAux(Unknown Source) ~[na:1.8.0_92]

You need to check that your LDAP parameters are valid.

Regards,

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/a8c02938-925a-4b29-a24e-c32d67cd86a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Julien LANCELOT | SonarSource

Sanrum Sandy

unread,
Jun 29, 2016, 10:47:01 AM6/29/16
to SonarQube, saroji...@gmail.com
Hi , 
   I am also facing the same issue, currently i am using sonarqube 5.6 version with Ldap plugin 2.0 . In the Sonar log , it says ldap connection is ok . But i am not able to login in the web page. I have placed the certifcate of LDAP server in keystore file as well. 

Could you please help me on this. 

Content of LDAP in sonar.properties file

#LDAP configuration
sonar.security.realm=LDAP
sonar.security.savePassword=true
sonar.security.updateUserAttributes=true
ldap.url=ldaps://<MyLDAP server>:<LDAP Server Port>
ldap.authentication=simple
# User Configuration
ldap.user.baseDn=ou=People
ldap.user.request=(&(objectClass=inetOrgPerson)(uid={login}))
ldap.user.realNameAttribute=cn
ldap.user.emailAttribute=uid

# Group Configuration
ldap.group.baseDn=ou=Groups
ldap.group.request=(&(objectClass=hpGroups)(memberUid={uid}))


thanks and regards, 
Santhanakumar .A

Sarojini Meher

unread,
Jul 4, 2016, 8:44:16 AM7/4/16
to SonarQube, saroji...@gmail.com
Hi, i have solved my problem by adding Active directory plugin along with LDAP plugin.

and mack sure that you are giving correct BaseDn property as you are saying connection to Ldap is ok but it not able to find the user .

You can get Ur basedn using this..

1. setspn -L <Username> 
type this command on command prompt when you are connected that network . 
Note : username will be your username  for ex: sarojini_meher

2.sonar.security.realm=ACTIVE_DIRECTORY
3.set the basedn=

restart Your server.

Hope this helps.

Sarojini

-----------------------------------------------------------------------------------------------------------------------------------

Julien Lancelot

unread,
Jul 7, 2016, 3:16:21 AM7/7/16
to Sarojini Meher, SonarQube
Hi Sarojini,

If you're using the ActiveDirectory plugin, you don't need to have the LDAP plugin, it's not use and I recommend you to uninstall it.

Regards,


For more options, visit https://groups.google.com/d/optout.

pv.sr...@gmail.com

unread,
Oct 17, 2017, 2:40:17 PM10/17/17
to SonarQube
hae I'm having exactly same issue but unable to find AD plugin could you please share me the link of plugin library where did you install this from, this would be great help.

Sravan Kumar

unread,
Oct 22, 2017, 10:02:23 PM10/22/17
to SonarQube
Not able to use security.realm=ACTIVE_DIRECTORY 

You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/ESdZj1E4bVE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/cd7162be-fd3a-4a70-bd58-33d2651f46f0%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
Thanks & Regards,
Sravan Kumar
Reply all
Reply to author
Forward
0 new messages