Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any example what to set adminGroup and so is_admin = 1 ? #160

Open
jasonwee opened this issue Apr 18, 2023 · 2 comments
Open

any example what to set adminGroup and so is_admin = 1 ? #160

jasonwee opened this issue Apr 18, 2023 · 2 comments

Comments

@jasonwee
Copy link

jasonwee commented Apr 18, 2023

I have the following trim down config.yaml

  adminGroup: cn=WireGuardAdmins,ou=Group,dc=acme,dc=com
  loginFilter: (&(objectClass=organizationalPerson)(uid={{login_identifier}}))
  syncFilter: (&(|(objectClass=inetOrgPerson)))
  syncGroupFilter: (objectClass=Group)

In the ldap, I have created WireGuardAdmins under Group and added a few users under this group. When I start wg-portal, it sync from ldap successfully but the flag for is_admin always 0. How to set that flag to one so I don't have to set it via sqlite ?

@philippderdiedas
Copy link
Contributor

Correct me if I'm wrong, but in https://github.com/h44z/wg-portal/blob/master/internal/authentication/providers/ldap/provider.go#L147 the script iterates over the users groups and matches the admin group from the config. Assuming you don't have an Active Directory, you have to add memberOf=(admin group dn here) to your user in LDAP.

@Sarevok933219
Copy link

I have the same case. In our LDAP scheme we don't use memberOf attribute, but we have memberUid. And Portal can't match any groups only users. Please if it's possible give an extended example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants