simplesamlphp / simplesamlphp/simplesamlphp-module-ldap
dn missing in attributes ?
Personne n'a encore pris cette issue.
- Langage dominant
- PHP
- Étoiles
- 5
- Forks
- 14
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I've got a simple authproc that calls ldap:AttributeAddUsersGroups to get the user's group information. Our LDAP is OpenLDAP that has groups with both groupOfNames and posixGroup objectclasses. So we have both uniqueMember and memberuid attributes our groups.
If I call that authproc like this - it works, the uid is used and matches the memberUid attribute:
50 => [
'class' => 'ldap:AttributeAddUsersGroups',
'authsource' => 'ldap',
'ldap.product' => 'OpenLDAP',
'search.base' => [
'ou=Groups,dc=mycompany,dc=com',
],
'attribute.dn' => 'dn',
'attribute.return' => 'cn',
'attribute.groups' => 'groups',
'attribute.username' => 'uid',
'attribute.memberOf' => 'memberuid',
'timeout' => 30,
],
However if I call it like this:
50 => [
'class' => 'ldap:AttributeAddUsersGroups',
'authsource' => 'ldap',
'ldap.product' => 'OpenLDAP',
'search.base' => [
'ou=Groups,dc=mycompany,dc=com',
],
'attribute.dn' => 'dn',
'attribute.return' => 'cn',
'attribute.groups' => 'groups',
'attribute.username' => 'dn',
'attribute.memberOf' => 'uniquemember',
'timeout' => 30,
],
I get an error telling me 'dn' is not found in the attributes array. So, I added another authproc call to ldap:AttributeAddFromLDAP to go specifically grab 'dn' for the user. To my knowledge 'dn' is always returned by LDAP searches, but I figured let's try this:
40 => [
'class' => 'ldap:AttributeAddFromLDAP',
'authsource' => 'ldap',
'attributes' => ['dn'],
'attribute.policy' => 'add',
'search.filter' => '(cn=%cn%)',
],
Which itself works without error, but I still get the following on the very next call to 'ldap:AttributeAddUsersGroups' :
SimpleSAML\Error\Exception: Warning - Undefined array key "dn" at /usr/local/install/simplesamlphp/modules/ldap/src/Auth/Process/AttributeAddUsersGroups.php:229
I can't find where or if 'dn' is somehow being filtered out but the attribute is definitely being returned by a search.
We'd like to switch to using the DN where we can but this has been a roadblock I can't figure out.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par modules/ldap/src/Auth/Process/AttributeAddUsersGroups.php à la ligne 229, puis comparez la configuration ldap:AttributeAddFromLDAP précédente avec les paramètres de AttributeAddUsersGroups dans le rapport. Reproduisez l’avertissement à l’aide des deux appels authproc et examinez les attributs transmis entre eux. C’est terminé lorsque la recherche de groupes basée sur le DN ne déclenche plus l’avertissement de clé manquante et renvoie les groupes attendus.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- php
- Domaine
- authentication
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100