simplesamlphp / simplesamlphp/simplesamlphp-module-ldap
dn missing in attributes ?
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- PHP
- Estrellas
- 5
- Forks
- 14
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con modules/ldap/src/Auth/Process/AttributeAddUsersGroups.php en la línea 229 y compara después la configuración ldap:AttributeAddFromLDAP anterior con los ajustes de AttributeAddUsersGroups del informe. Reproduce la advertencia usando las dos llamadas a authproc e inspecciona los atributos que se pasan entre ellas. Se considerará terminado cuando la búsqueda de grupos basada en DN ya no genere la advertencia de clave ausente y devuelva los grupos esperados.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- php
- Área
- authentication
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100