Forum général.général MediaWiki et filtre de group LDAP

Posté par  (site web personnel) .
Étiquettes : aucune
0
21
mai
2010
Bonjour,

Je viens de mettre en place un MediaWiki pour ma société et ça tourne niquel. Les utilisateurs doivent se connecter via leur login/mot de passe OpenLDAP et donc j'utilise le plugin adéquat.

Tout fonctionne, sauf la restriction par groupe, je suppose que j'ai une erreur dans ma configuration, pourriez-vous la vérifier ? MediaWiki est en version 1.15 et le plugin ldap en 2.2. J'ai déjà comparé mon soucis à certain posts équivalent sur internet sans succès.

Voici ma config (LocalSettings.php) :


$wgAuth = new LdapAuthenticationPlugin();

// Debug info
//$wgLDAPDebug = 3;
//$wgDebugLogGroups["ldap"] = "/tmp/debug.log" ;

// Authentication & connect info to search in LDAP
$wgLDAPProxyAgent = array( "LDAP" => "cn=admin,dc=company,dc=local" );
$wgLDAPProxyAgentPassword = array( "LDAP" => "pwd" );
$wgLDAPServerNames = array( "LDAP" => "server.company.local" );
$wgLDAPEncryptionType = array( "LDAP" => "ssl" );

// How to bind a User
$wgLDAPUseLocal = false;
$wgLDAPDomainNames = array( "LDAP" );
$wgLDAPSearchAttributes = array( "LDAP" => "uid" );
$wgLDAPBaseDNs = array( "LDAP"=>"dc=company,dc=local" );


// Group restrictions
$wgLDAPRequiredGroups = array ("LDAP" => array ("cn=server,ou=Group,dc=company,dc=local") );
$wgLDAPGroupUseFullDN = array( "LDAP"=>true );
$wgLDAPGroupObjectclass = array( "LDAP"=>"posixGroup" );
$wgLDAPGroupAttribute = array( "LDAP"=>"memberUid" );
$wgLDAPGroupNameAttribute = array( "LDAP"=>"cn" );


L'erreur que MediaWiki me donne en mode Debug est qu'il pense que l'utilisateur ne fait partie d'aucun groupe (ce qui est incorrect).

Merci d'avance,
  • # ldapsearch

    Posté par  (site web personnel) . Évalué à 1.

    La requête ldap en ligne de commande renvoie le résultat attendu ?

    Système - Réseau - Sécurité Open Source

    • [^] # Re: ldapsearch

      Posté par  (site web personnel) . Évalué à 1.

      Si je tape par exemple :


      ldapsearch -b "dc=company,dc=local" "(&(memberUid=cn=Henry-Nicolas Tourneur,ou=People,dc=company,dc=local)(objectclass=posixGroup))" o description


      J'ai comme résultat :

      ldap_sasl_interactive_bind_s: No such attribute (16)


      Maintenant j'avoue que je ne suis pas un expert des commandes LDAP, j'ai installé slapd dans Debian et configuré avec le SSL et je l'utilise dans PAM + qq logiciels mais ça s'arrête là.
      • [^] # Re: ldapsearch

        Posté par  (site web personnel) . Évalué à 1.

        Essaie en "simple" c-a-d sans sasl, de mémoire c'est -x l'option.

        Système - Réseau - Sécurité Open Source

        • [^] # Re: ldapsearch

          Posté par  (site web personnel) . Évalué à 1.

          Alors le résultat donne :


          # extended LDIF
          #
          # LDAPv3
          # base <dc=company,dc=local> with scope subtree
          # filter: (&(memberUid=cn=Henry-Nicolas Tourneur,ou=People,dc=company,dc=local)(objectclass=posixGroup))
          # requesting: o description
          #

          # search result
          search: 2
          result: 0 Success

          # numResponses: 1
          • [^] # Re: ldapsearch

            Posté par  (site web personnel) . Évalué à 1.

            L'authentification fonctionne en simple et sasl.

            La requete retourne aucun résultat.

            Un ldif de l'entree correspondante serait utile.

            Système - Réseau - Sécurité Open Source

            • [^] # Re: ldapsearch

              Posté par  (site web personnel) . Évalué à 1.

              Voici donc le ldif de mon compte LDAP :


              dn: cn=Henry-Nicolas Tourneur,ou=Provisioning,ou=People,dc=company,dc=loc
              al
              objectClass: inetOrgPerson
              objectClass: posixAccount
              objectClass: top
              givenName: Henry-Nicolas
              sn: Tourneur
              uid: hnt
              uidNumber: 1000
              homeDirectory: /home/hnt
              loginShell: /bin/sh
              cn: Henry-Nicolas Tourneur
              userPassword: {crypt}blub
              gidNumber: 1003


              Et le LDIF du groupe dans lequel il faut être membre :

              dn: cn=server,ou=Group,dc=company,dc=local
              objectClass: posixGroup
              objectClass: top
              userPassword: {crypt}x
              gidNumber: 1003
              cn: server
              memberUid: hnt


              Et donc moi je me connecte avec l'account hnt.
              • [^] # Re: ldapsearch

                Posté par  (site web personnel) . Évalué à 1.

                Peut etre:

                http://wawadeb.crdp.ac-caen.fr/iso/tmp/stage/divers/ldap/rec(...)


                attention member != memberUid

                La requete est peut etre incorrecte ou le champs mal renseigné:


                ou
                memberUid=cn=Henry-Nicolas Tourneur

                Système - Réseau - Sécurité Open Source

                • [^] # Re: ldapsearch

                  Posté par  (site web personnel) . Évalué à 1.

                  La requete: ( tout du moins le filtre )

                  (&(memberUid=*,ou=People,dc=company,dc=local)(objectclass=posixGroup))

                  Système - Réseau - Sécurité Open Source

                • [^] # Re: ldapsearch

                  Posté par  (site web personnel) . Évalué à 1.

                  Bon, vu que j'arrive pas à corriger ma requête, je poste le log d'erreur de mediawiki car on ne sait jamais :


                  Entering Connect
                  Using SSL
                  Using servers: ldaps://server.company.local
                  Connected successfully
                  Entering getSearchString
                  Doing a proxy bind
                  Entering getUserDN
                  Created a regular filter: (uid=Hnt)
                  Entering getBaseDN
                  basedn is not set for this type of entry, trying to get the default basedn.
                  Entering getBaseDN
                  basedn is dc=company,dc=local
                  Using base: dc=company,dc=local
                  Fetched username is not a string (check your hook code...). This message can be safely ignored if you do not have the SetUsern
                  ameAttributeFromLDAP hook defined.
                  userdn is: cn=Henry-Nicolas Tourneur,ou=People,dc=company,dc=local

                  Binding as the user
                  Bound successfully
                  Entering getGroups
                  Retrieving LDAP group membership
                  Searching for the groups
                  Entering searchGroups
                  Entering getBaseDN
                  basedn is not set for this type of entry, trying to get the default basedn.
                  Entering getBaseDN
                  basedn is dc=company,dc=local
                  Search string: (&(memberUid=cn=Henry-Nicolas Tourneur,ou=People,dc=company,dc=local)(objectclass=posixGroup))
                  Binding as the proxyagent
                  Returned groups:
                  Entering checkGroups
                  Checking for (new style) group membership
                  Required groups: cn=server,ou=group,dc=company,dc=local
                  Couldn't find the user in any groups.
                  Entering strict.
                  Returning true in strict().
                  Entering allowPasswordChange
                  Entering modifyUITemplate

Suivre le flux des commentaires

Note : les commentaires appartiennent à celles et ceux qui les ont postés. Nous n’en sommes pas responsables.