Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 70 Next »

Compatibility matrix


Apache DS



Active Directory































(tick) - means that it was tested



This is documentation for plugin version 1.1 and greater. Documentation for version prior to 1.1 located on separate page.

The Sonar LDAP Plugin enables the delegation of Sonar authentication and authorization to an external system. The plugin currently supports LDAP and Microsoft Active Directory.

The main features of the plugin are :

  • Password checking against the external authentication engine
  • Automatic synchronization of usernames and emails
  • Automatic synchronization of the relationships between users and groups (authorization)
  • Ability to authenticate the user both against the external or internal authentication systems (technical Sonar user accounts have no need for instance to be defined in the LDAP server)

By default there is no need to firstly create a user account in the Sonar DB to allow a user to log into Sonar. During the first authentication trial, if the password is correct, the Sonar DB is automatically populated with the new Sonar user. Moreover, each time a user logs into Sonar, the username, the email and the groups this user belongs to are automatically refreshed in the Sonar DB.

About the delegation of authorization, there are only one pre-requisite : the relationships between users and groups are only synchronized with groups which are already defined in the Sonar. So groups and related permissions must be first defined in Sonar.

Usage & Installation

  1. Download the plugin from Update Center and restart server. If you don't have access to Internet, then manually download JAR file into $SONAR_HOME/extensions/plugins and restart server.
  2. Make sure that at least one user with global administration role exists in Sonar as well as in the external system
  3. Configure the LDAP plugin by editing the conf/ file (see below)

  4. Restart the Sonar server and check the log file for:

    INFO org.sonar.INFO Authentication plugin: class com.teklabs.sonar.plugins.ldap.LdapAuthenticator
    INFO org.sonar.INFO Authentication plugin started
  5. Log in to Sonar

General Configuration

PropertyDescriptionDefault valueMandatoryExample

This property must be defined to ask the Sonar server to use first the LDAP plugin when trying to authenticate a user. (available since Sonar 2.14)

 YesLDAP (no other value can be used) optional property can be used to ask Sonar to save the user password in the Sonar DB. When this property is activated, a user can log into Sonar even when the LDAP server is not available. (available since Sonar 2.14)falseNo 
sonar.authenticator.createUsersBy default, the Sonar DB is automatically populated when a new Sonar user logs into Sonar. Setting this value to false, make it mandatory for a Sonar administrator to first declare a user in the Sonar DB before allowing this user to log into Sonar. (available since Sonar 2.0).trueNo 
ldap.urlURL of the LDAP server. Note that if you are using ldaps, then you should install server certificate into java truststore. Yesldap://localhost:10389
ldap.bindDnBind DN is the username of an LDAP user to connect (or bind) with. Leave blank for anonymous access to the LDAP directory. Nocn=sonar,ou=users,o=mycompany
ldap.bindPasswordBind Password is the password of the user to connect with. Leave blank for anonymous access to the LDAP directory. Nosecret
ldap.authenticationPossible values: 'simple', 'CRAM-MD5', 'DIGEST-MD5', 'GSSAPI'. See 
ldap.contextFactoryClass(advanced option) Context factory 

User Mapping

PropertyDescriptionDefault valueExample for Active Directory Server
ldap.user.baseDnDistinguished Name (DN) of the root node in LDAP from which to search for users. cn=users,dc=example,dc=org
ldap.user.objectClassObject class of LDAP users.inetOrgPersonuser
ldap.user.loginAttributeAttribute in LDAP holding the user’s login.uidsAMAccountName
ldap.user.realNameAttributeAttribute in LDAP holding the user’s real name.cncn
ldap.user.emailAttributeAttribute in LDAP holding the user’s email.mailmail

Group Mapping

Supported only static type of groups - when group contains list of users, but not dynamic - when user entry contains attribute ( memberOf ) with list of groups.

PropertyDescriptionDefault valueExample for Active Directory Server Name (DN) of the root node in LDAP from which to search for groups. cn=groups,dc=example,dc=org class of LDAP groups.groupOfUniqueNamesgroup in LDAP holding the group's id.cncn in LDAP holding the group's member.uniqueMembermember


Here is description of how auto-discovery works:

  1. Determining DNS Domain Name:
    • from "ldap.realm" property if set
    • from FQDN of machine, where Sonar installed (eg. if FQDN is "", then DNS Domain Name will be "")
  2. Determining URL of LDAP server:
    • from "ldap.url" property if set
    • from DNS server ( see known limitations ), here is example of SRV Record for domain "": 72784   IN      SRV     0 5 389

      for this domain URL of LDAP server will be "ldap://"

  3. Determining BaseDN:
    • from "ldap.baseDn" property if set
    • from DNS Domain Name (eg. if DNS Domain Name is "", then BaseDN will be "dc=example,dc=org")

Authentication Methods

  • Simple
    Simple authentication is not recommended for production deployments not using the secure ldaps protocol as it sends a cleartext password over the network.
  • Anonymous
    Used when only needs read-only access to non-protected entries and attributes when binding to the LDAP server.
  • CRAM-MD5
    The Challenge-Response Authentication Method (CRAM) based on the HMAC-MD5 MAC algorithm (RFC 2195).
    This is an improvement on the CRAM-MD5 authentication method (RFC 2831).
    GSS-API is Generic Security Service API (RFC 2744). One of the most popular security services available for GSS-API is the Kerberos v5, used in Microsoft's Windows 2000 platform.

For a full discussion of LDAP authentication approaches, see RFC 2829 and RFC 2251.

Known limitations

Auto-discovery takes into account only one SRV record.


You can enable debug logging by adding the following to conf/logback.xml:



com.atlassian.confluence.macro.MacroExecutionException: JIRA project does not exist or you do not have permission to view it.


Release 1.0 (1 issues)

T Key Summary P Status Resolution
Task SONARPLUGINS-764 Use sonar-plugin packaging Major Closed Fixed


Release 0.1 (8 issues)

  • No labels