Gerrit et Active Directory

Je suis en train de configurer Gerrit à l'utilisation de notre entreprise, Active Directory pour l'authentification. Je connais beaucoup de gens qui ont réussi à obtenir que cela fonctionne mais il ne va pas fonctionner pour moi.

Si je lance un ldapsearch commande comme suit-je obtenir le résultat correct, donc je sais que mon chaînes de recherche sont corrects:

ldapsearch -h myserver -b "CN=Users,DC=mycompany,DC=com" -D "CN=adam,CN=Users,DC=mycompany,DC=com" -w mypassword "(sAMAccountName=adam)"

Mais l'utilisation de ces mêmes paramètres dans mon Gerrit config ne fonctionne pas:

[auth]
    type = LDAP
[ldap]
    server = ldap://myserver
    accountBase = CN=Users,DC=mycompany,DC=com
    groupBase = OU=Gerrit,DC=mycompany,DC=com
    user = CN=adam,CN=Users,DC=mycompany,DC=com
    password = mypassword
    referral = follow
    accountPattern = (sAMAccountName=${username})
    groupPattern = (cn=${groupname})
    accountFullName = displayName
    accountMemberField = memberOf
    accountEmailAddress = mail

Quand j'essaie de me connecter avec mon compte, j'obtiens l'exception suivante dans etc/error_log:

[2012-05-04 10:03:04,595] ERROR com.google.gerrit.server.auth.ldap.LdapRealm : Cannot query LDAP to autenticate user
javax.naming.NamingException: [LDAP: error code 1 - 00000000: LdapErr: DSID-0C090627, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece^@]; remaining name 'CN=Users,DC=mycompany,DC=com'
    at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3072)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2978)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2785)
    at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1839)
    at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1762)
    at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1779)
    [...]

Quelqu'un a mis en place une configuration similaire qui pourrait être en mesure d'aider?

OriginalL'auteur Adam Rodger | 2012-05-04