I'm trying to create a new user on my LDAP server using the Symfony bundle The Ldap Component, but when i try to add the user to a group using memberOf attribute it fails.
if i remove the 'memberOf' attribute it inserts the user but not the group where the user belongs to.
$entry = new Entry('CN=Jon Doe2,OU=Moodle Users,DC=mwg,DC=local', [
'objectClass' => ['top', 'person', 'organizationalPerson','user'],
'cn' => ['Jon Doe2'],
'sn' => ['Doe'],
'givenName' => ['JonDoe2'],
'mail' => ['jondoe2@gmail.com'],
'description' => ['Moodle SSO User'],
'memberOf' => ['CN=Student,OU=Moodle Users,DC=mwg,DC=local'],
]);
I get the following error: Could not add entry "CN=Jon Doe2,OU=Moodle Users,DC=mwg,DC=local": Server is unwilling to perform.