mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 22:52:58 +03:00
🚀 Feature: Support addition LDAP group membership attributes #358
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 @koalaeagle on GitHub.
Originally assigned to: @kmendell on GitHub.
Feature description
I have recently setup pocket id with LDAP sync, and it is working great!
However, I did run into one issue in my environment. Group membership mappings were not working correctly. Looking through the source code, I found that the logic is querying for the "member" attribute of each group. However, my LDAP server (glauth) appears to be using the attribute "uniqueMember".
As a quick and dirty test, I replaced the two relevant occurrences of "member" (in searchAttrs and groupMembers declaration) in backend/internal/service/ldap_service.go and built the docker container. This immediately fixed my issue.
I am not sure how to best address this, but understand that due to the nature of LDAP there can be inconsistencies with mappings. If there aren't too many different commonly used identifiers for group members, perhaps it is worth implementing logic to discover what attribute is in use? Alternatively, this could be implemented as a configuration option like the other attribute mappings.
Pitch
This feature would ensure that group mappings work in different LDAP implementations/environments.
@kmendell commented on GitHub:
It is working as expected for the
memberattribute i cant not say for certain for @koalaeagle use case though.@koalaeagle commented on GitHub:
This worked perfectly for me!
Steps taken:
ghcr.io/pocket-id/pocket-id:developmentimage@kmendell commented on GitHub:
@koalaeagle I opened a PR here https://github.com/pocket-id/pocket-id/pull/236 , can you verify this is what you changed and is what your were asking for?
@kmendell commented on GitHub:
@stonith404 Should be good to merge this in if the code looks good to you.
@stonith404 commented on GitHub:
You can test it with the
ghcr.io/pocket-id/pocket-id:developmentimage.