h44z / wg-portal

WireGuard Configuration Portal with LDAP connection
https://wgportal.org/
MIT License
959 stars 127 forks source link

How to configure OpenLDAP posixGroup ? #180

Closed artempal closed 1 year ago

artempal commented 1 year ago

I am using OpenLDAP 2.4.44 and wg-portal 1.0.18 How can I sync a specific group in this case? Only members of the "stage" group should use the wg-portal.

ldapsearch -x -D "cn=wg,ou=Service,dc=test,dc=local" -W -b "cn=stage,ou=Group,dc=test,dc=local" "(&(|(objectclass=*)))"

# stage, Group, servicepipe.ru
dn: cn=stage,ou=Group,dc=test,dc=local
cn: stage
gidNumber: 10008
objectClass: posixGroup
objectClass: top
description: Test
memberUid: testuser
memberUid: testuser2

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1
ldapsearch -x -D "cn=wg,ou=Service,dc=test,dc=local" -W -b "cn=testuser,ou=People,dc=test,dc=local"

# testuser
, People, test.local

objectClass: posixAccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
uid: testuser
uidNumber: 10109
gidNumber: 10000
mail: testuser@test.local
artempal commented 1 year ago

I solved the problem by including memberof in openldap and using groupOfNames