Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

Creating new user on LDAP server using The LDAP Component for symfony and adding memberOf

$
0
0

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.


Viewing all articles
Browse latest Browse all 3925

Trending Articles