mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-06 09:13:19 +03:00
🐛 Bug Report: LDAP Admin Group Name not working #80
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CorentinGrard on GitHub.
Originally assigned to: @kmendell on GitHub.
Reproduction steps
I'm trying in use LLDAP with PocketID. I'm new to LDAP so it's possible I've made a mistake.
Prerequire LLDAP.
In LLDAP
Expected behavior
When adding a group name in Admin Group Name, it should make the users in the group admin in pocket id
Actual Behavior
When configuring LDAP on PocketID after entering all the values you will find bellow, I managed to sync my LDAP with PocketID, but I cannot make work the Admin Group Name field.
On LLDAP I have a group called
adminwith a user in it. I have addedadminin the fieldAdmin Group NamePocket ID LDAP config:

LLDAP User Attributes:

LLDAP Group Attributes:

PocketID User:

LLDAP admin User:

Version and Environment
v1.7
Log Output
No response
@kmendell commented on GitHub:
Change the Group Name Attribute to
cnthat should fix it for now. Ill try to look into a fix, but i think its a missconception with lldaps schema to be honest.@kmendell commented on GitHub:
So its not a bug, moreover a misnaming of variables and the fields.
What LLDAP returns in memberOf on users:
memberOf: cn=admin,ou=groups,dc=pocket-id,dc=org
What the admin group object looks like:
What PocketID’s current code does
For each memberOf DN, it extracts the configured “Group Name Attribute” from the DN and compares it to “Admin Group Name”.
So how we get this info is:
The distinguishedName ends up being
display_name=admin,ou=groups,dc=pocket-id,dc=orgWhich is not valid ldap syntax for a DN. The display name in lldap is a attribute not part of the distinguisedName. So this may be a misnamed thing on pocket-ids part as well.
Most likley the easiest fix here is to rename the field. Which i opened a PR for, but well want to rename the actual variable as well.
@CorentinGrard commented on GitHub:
Yes that did the trick, thanks @kmendell