I am trying to set up an eduPersonAffiliation attribute based on the DN, so if a user's DN is uid=foo,ou=staff,dc=example,dc=com, the affilitaion should be
st...@example.com.
Problem is I cannot get DN from my OpenLDAP. It is not part of the $attributes vector so an authproc filter does not see the DN.
in authsources.php:
...
'xx-ldap' => array(
'ldap:LDAP',
'enable_tls' => TRUE,
'attributes' => array('uid', 'givenName', 'sn', 'mail', 'dn'),
'dnpattern' => 'uid=%username%,ou=staff,dc=example,dc=com',
...
May 7 09:15:22 idp2 simplesamlphp[4679]: 7 [8b6d57a04f] Library - LDAP getAttributes(): Getting 'uid,givenName,sn,mail,dn' from DN 'uid=foo,ou=staff,dc=pingpong,dc=net'
May 7 09:15:22 idp2 simplesamlphp[4679]: 7 [8b6d57a04f] Library - LDAP getAttributes(): Found attributes '(uid,sn,givenName,mail)'
Palle