i have a function that generates LDAP User object from data received from Keycloak and sends it via search response. commented are problematic:
const fabricatedObject = {
dn: 'uid=' + keycloakUser.username + ',ou=' + keycloakUser.attributes.ou + ',o=organization',
attributes: {
objectClass: ['person', 'top', 'organizationalPerson', 'inetOrgPerson', 'posixAccount'], // PROBLEMATIC
cn: keycloakUser.firstName + ' ' + keycloakUser.lastName,
displayName: keycloakUser.firstName + ' ' + keycloakUser.lastName, // PROBLEMATIC
givenName: keycloakUser.firstName, // PROBLEMATIC
sn: keycloakUser.lastName,
ou: (keycloakUser.attributes.ou || "none"),
mail: keycloakUser.email.toString(),
uid: keycloakUser.username.toString(),
entryUUID: keycloakUser.attributes.LDAP_ID || keycloakUser.id, // PROBLEMATIC
keycloakId: keycloakUser.id.toString(), // PROBLEMATIC
ldapId: (keycloakUser.attributes.LDAP_ID || "none").toString() // PROBLEMATIC
},
this does not return entryUUID nor ldapId (applies for all bold marked above):
ldapsearch -H ldap://localhost:10389 -x -b o=organization -D BINDUSER -w BINDPASS "(uid=*)" "mail" "entryUUID" "ldapId"
but this does (and mixed-case entryUUID and ldapId is received:
ldapsearch -H ldap://localhost:10389 -x -b o=organization -D BINDUSER -w BINDPASS "(uid=*)" "mail" "entryuuid" "ldapid"
the point is, that specifying exact case of "entryUUID" is wrong. I have to ask for lowercase "entryuuid" in order to receive attribute "entryUUID" with it's value
this is easily fixable, can I offer a quick PR for this? I believe it's not intended behaviour, as clients shall be able to use upper or lowercase attribute names.
LDAP Attributes are case insensitive, so I believe searching for "ENTRYUUID", "entryuuid" and "entryUUID" shall always return the entryUUID that's defined in the generator function above.